Hope everyone in the US had a great Turkey Day (Thanksgiving) and are now enjoying the last weekend of November. Im busy with NaNoWriMo, and a bit behind. So I give you another program from my original ZX81 site, but not yet featured here. Novembers program is the month is Maze Craze. Its not hard, but you might need to graph out the maze if you get stuck. There are actually two mazes. Can you beat them both?
As a program, Maze Craze is a study in reuse. I used a number of routines to represent the different views the maze could take. The actually create the maze, I represented by a number of GOSUB routines. I originally developed the mazes on graph paper and transferred each path into code. A pretty simple process that ends up working well.
For some reason, I used an INPUT instead of INKEY$ to the direction the player wanted to go. Id probably redo those entry routines if I were to write this again. If I had, I might also have allowed a more free-flowing maze. Perhaps one that you could turn around in and retrace your steps.
For some reason, I also added a PAUSE 1 statement after I printed each corridor. Im not sure why. Perhaps I was just wanting a small pause between displays, but I doubt anyone would notice a delay that small. The other reason I might have used the pause is to cause the display to flicker. Now that I think about it, that might have been why. Since I only display each square you are standing at, it would be hard to notice that you had moved. Depending on your emulator, however, you may not see the flicker at all.
And there you go. A short little maze to relax to before December.