Variations on a maze

From Maze

(Difference between revisions)
Jump to: navigation, search
(→Four Walls)
(→Patterns)
Line 62:Line 62:
Several things about this visual orientation are surprising. First, when we visually trace the maze the long runs or paths that lead through the maze do not follow the lines along which the algorithm constructs the maze (which remains left-right, top-bottom). Second, this feature of being diagnol is not an elaboration in the code, but instead an elegant simplification that is part of the essence of the succinct one-liner.
Several things about this visual orientation are surprising. First, when we visually trace the maze the long runs or paths that lead through the maze do not follow the lines along which the algorithm constructs the maze (which remains left-right, top-bottom). Second, this feature of being diagnol is not an elaboration in the code, but instead an elegant simplification that is part of the essence of the succinct one-liner.
 +
<blockquote>10 PRINT CHR$(109+RND(1)*2); : GOTO 10</blockquote>
 +
=== Orthogonal Weave ===
=== Orthogonal Weave ===
Line 67:Line 69:
There are no other two characters in the [http://en.wikipedia.org/wiki/PETSCII PETSCII] 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 [http://en.wikipedia.org/wiki/PETSCII PETSCII] 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.
 +
 +
<blockquote>10 PRINT CHR$(102+RND(1)*2); : GOTO 10</blockquote>
=== Corners ===
=== Corners ===
Line 84:Line 88:
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.
−
10 PRINT CHR$(181+(INT(RND(1)+.5)*3)+(INT(RND(1)+.5))); : GOTO 10
+
<blockquote>10 PRINT CHR$(181+(INT(RND(1)+.5)*3)+(INT(RND(1)+.5))); : GOTO 10</blockquote>
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.
Line 94:Line 98:
(...discuss how 181/184 is the best approximation of the classic orthogonal game aesthetic, but it is still less elegant than 109/110 -- we have to carefully force the random result to an INT before introducing an offset multiplier, which adds length to the line, conceptual complexity to the demo, AND as a result we get a less visually interesting output -- that is, it is both less formally dynamic as a design and less contextually unexpected).
(...discuss how 181/184 is the best approximation of the classic orthogonal game aesthetic, but it is still less elegant than 109/110 -- we have to carefully force the random result to an INT before introducing an offset multiplier, which adds length to the line, conceptual complexity to the demo, AND as a result we get a less visually interesting output -- that is, it is both less formally dynamic as a design and less contextually unexpected).
−
10 PRINT CHR$(181+(INT(RND(1)+.5)*3)); : GOTO 10
+
<blockquote>10 PRINT CHR$(181+(INT(RND(1)+.5)*3)); : GOTO 10</blockquote>
== See Also ==
== See Also ==

Revision as of 19:52, 29 July 2010

View this revision of Variations on a maze.

Personal tools