The textbox below the maze contains a per-cell encoding of which walls exist. Each cell is represented by a single digit (0–3), and each row is terminated by a | character.
Each digit encodes the state of two walls of the cell as a 2-bit value:
The top and left walls are not encoded per-cell, because they are the bottom/right walls of the neighboring cells (or the outer maze border).
| Digit | Bottom wall | Right wall | Cell looks like |
|---|---|---|---|
0 | no | no | |
1 | yes | no | |
2 | no | yes | |
3 | yes | yes |
Each row of the maze is terminated by a | character. Rows are listed top-to-bottom, cells within a row left-to-right.
Consider this 4-character string for a 2×2 maze:
21|03|
This decodes as:
| Position | Digit | Walls |
|---|---|---|
| row 0, col 0 | 2 | right wall only |
| row 0, col 1 | 1 | bottom wall only |
| row 1, col 0 | 0 | no walls |
| row 1, col 1 | 3 | bottom and right walls |
Rendered (with the implicit outer border drawn in for clarity):
Two walls per cell is the minimum needed to fully describe a rectangular maze without redundancy. Encoding only the bottom and right walls means each cell's data is independent of its neighbors’ data, and the outer border (top edge of row 0, left edge of column 0) is implicit.
Note that the output also implies two openings in the outer border: a "start" point at the top-left, which omits the left outer wall of cell (0,0), and a "goal" point at the bottom-right, which omits the right outer wall of cell (X-1, Y-1) for a maze of size X by Y.