Variations on a maze
From Maze
---
Atari2600-Adventure-v2-(vgmaps).png
1920 × 2317 pixels
Atari2600-pacman.gif
320 × 200 pixels
Atari2600-maze_craze.png
640 × 350 pixels
One common feature of the many different maze games from the period is orientation: all both rectilinear and aligned to the Cartesian axes. Different examples have their own aesthetics -- Pac Man partitions the screen space into an open field a indirect routes, Maze Craze creates a traditional full-screen overview with a single solution, while Adventure produces a claustrophobic view in which only part of the impossibly wrapping maze topology is visible at any time -- usually nearby but inaccessible paths. What all have in common is that they are constructed of horizontal/vertical walls that are orthogonal to the edges of the screen and the scan line of the display.
By contrast, the maze output of 10 PRINT is oriented diagonally, giving it a distinctive visual look. 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 maze is constructed (which remains left-right, top-bottom). Second, this is not an elaboration, but actually an elegant simplification that is part of the essence of the succinct one-liner. There are no two characters that, when substituted for our "\" and "/", will result in the construction of a traditional orthogonal maze. Vertical and horizontal bars result in a disconnected weave, while solid and empty squares result in rough static.
10print-orthogonal-weave.png
464 × 366 pixels
As it turns out, diagonal mazes are symbolically efficient on a Cartesian grid due to the fact that four characters meet at the corners, whereas only two meet along an edge. Thus, intersections of up to four lines (the building blocks of a rectilinear maze) can be created at corners if we use diagonal lines.
We 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 top-wall, bottom-wall, left-wall and right-wall. 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 replaced with something more verbose -- for example, selecting between 180, 181, 183 and 184 using two random offsets.
10 PRINT CHR$(181+(.5+INT(RND(1))*2)+(RND(1))); : GOTO 10
NOTE: 4-char and 5-char versions here: 10 PRINT CHR$(181+(.5+INT(RND(1))*2)+(RND(1))); : GOTO 10
---
