Variations on a maze
From Maze
(Difference between revisions)
| Line 6: | Line 6: | ||
=== Diagonals === | === Diagonals === | ||
| − | [[Image:10print-diagonal.png|200px|thumb|left|text-top|10 PRINT CHR$(109+RND(1)*2); : GOTO 10]] | + | [[Image:10print-diagonal.png|200px|thumb|10 PRINT CHR$(109+RND(1)*2); : GOTO 10]] |
By contrast, the maze output of 10 PRINT is oriented diagonally, giving it a distinctive visual look. | By contrast, the maze output of 10 PRINT is oriented diagonally, giving it a distinctive visual look. | ||
| Line 14: | Line 14: | ||
=== Verticals as Weave === | === Verticals as Weave === | ||
| − | [[Image:10print-orthogonal-weave.png|200px|thumb|left|text-top|10 PRINT CHR$(102+RND(1)*2); : GOTO 10]] | + | [[Image:10print-orthogonal-weave.png|200px|thumb|10 PRINT CHR$(102+RND(1)*2); : GOTO 10]] |
There are no other two characters in the <a href="http://en.wikipedia.org/wiki/PETSCII">PETSCII</a> data set that, when substituted for our "\" and "/", will result in the construction of a traditional orthogonal maze. Vertical and horizontal bars, for example, result in a disconnected weave, while solid and empty squares result in rough static. | There are no other two characters in the <a href="http://en.wikipedia.org/wiki/PETSCII">PETSCII</a> data set that, when substituted for our "\" and "/", will result in the construction of a traditional orthogonal maze. Vertical and horizontal bars, for example, result in a disconnected weave, while solid and empty squares result in rough static. | ||
| Line 20: | Line 20: | ||
=== Corners === | === Corners === | ||
| − | [[Image:10print-elbows.png|200px|thumb|left|text-top|10 PRINT CHR$(108+(INT(RND(1)+.5)*3)); : GOTO 10]] | + | [[Image:10print-elbows.png|200px|thumb|10 PRINT CHR$(108+(INT(RND(1)+.5)*3)); : GOTO 10]] |
Randomly selecting corner pieces such as "L", on the other hand, simply turn the image into a honeycomb. | Randomly selecting corner pieces such as "L", on the other hand, simply turn the image into a honeycomb. | ||
| Line 32: | Line 32: | ||
One can, of course, construct an orthogonal maze instead in a variety of other ways. One way is to address a set of four or more horizontal character elements a l. There are two styles of these characters (thick and thin) available in the Commodore 64 ASCII character set. However, these four character types never appear continuously in the table, so the elegant method of using a simple RND offset must be made a bit more verbose -- for example, selecting between 181, 182, 184 and 185 using two random offsets. | One can, of course, construct an orthogonal maze instead in a variety of other ways. One way is to address a set of four or more horizontal character elements a l. There are two styles of these characters (thick and thin) available in the Commodore 64 ASCII character set. However, these four character types never appear continuously in the table, so the elegant method of using a simple RND offset must be made a bit more verbose -- for example, selecting between 181, 182, 184 and 185 using two random offsets. | ||
| − | [[Image:10print-orthogonal-rough.png|200px|thumb|left|text-top|10 PRINT CHR$(181+(INT(RND(1)+.5)*3)+(INT(RND(1)+.5))); : GOTO 10]] | + | [[Image:10print-orthogonal-rough.png|200px|thumb|10 PRINT CHR$(181+(INT(RND(1)+.5)*3)+(INT(RND(1)+.5))); : GOTO 10]] |
The image that emerges is indeed mazelike, but (like the code) lacks simplicity and elegance. potential redundancy between the top / bottom and left / right elements creates apparent variation in the thickness of the walls -- an interesting but potentially distracting implication of messiness and texture. | The image that emerges is indeed mazelike, but (like the code) lacks simplicity and elegance. potential redundancy between the top / bottom and left / right elements creates apparent variation in the thickness of the walls -- an interesting but potentially distracting implication of messiness and texture. | ||
| − | [[Image:10print-orthogonal.png|200px|thumb|left|text-top|10 PRINT CHR$(181+(INT(RND(1)+.5)*3)); : GOTO 10]] | + | [[Image:10print-orthogonal.png|200px|thumb|10 PRINT CHR$(181+(INT(RND(1)+.5)*3)); : GOTO 10]] |
--- | --- | ||
