It turned out that the maze is generated in a sequence. The game needs to decide, as it draws each new square of the maze, whether it should draw a wall or a space for the game characters to move around in. Each square should therefore be “wall” or “no wall” – “1” or “0” in computer bits. The game’s algorithm decides this automatically by analysing a section of the maze. It uses a five-square tile that looks a little like a Tetris piece. This tile determines the nature of the next square in each row.
How? That’s the fascinating part. The fundamental logic that determines the next square is locked in a table of possible values written into the game’s code. Depending on the values of the five-square tile, the table tells the game to deposit either wall, no wall or a random choice between the two.
It seems straightforward, but the thing is, no-one can work out how the table was made.
Aycock and Copplestone have tried retro-engineering the table. They looked for patterns in the values to try and reveal how it was designed, but this was to no avail. Whatever the programmer did, it was a stroke of mild genius. Every time the game is played, a reliably navigable maze is pumped out. Were the table’s values random or even slightly different, the maze would likely fail to be drawn with a playable path through it. It just seems impossible to explain.