Here's my tribute to Random Terrain.
I created a 7800 maze generator a few weeks ago with the intention of creating one for batari Basic too, and I just finished it up. It will generate a random playfield maze every time it's run. Once it's complete press the fire button to generate a new maze. It uses the standard kernel and superchip RAM for a 32x32 playfield.
The maze is created using the Binary Tree algorithm. Each playfield block is analyzed from left to right line by line, checking the blocks directly to the south and the east. If one of them already has an opening, the block is skipped. If there are no openings to the south or west, one block is randomly cleared, and we move on to the next. It could be changed to use any combination of adjacent directions (NE, NW, SE, or SW) which will change the layout.
It's not a perfect implementation of the algorithm as I add a border around the outside, as well as clearing a path in the top right and lower left due to the fact that this algorighm tends to favor diagonals and inaccessible areas would otherwise be created in the top right and bottom left. There's plenty of code tweaking that could be done to change up how the resulting mazes appear.
The code is pretty short and efficient and it should be fairly easy to adapt this into a game. Anyone that wants to use this code as the basis for a new game is free to do so. I just haven't come up with a good game idea to use this code with yet.