Hi B9,
I don’t know much about the Tandy 200. I’m surprised that the program works on it at all. When I load the .DO file into BASIC, before saving it as a .BA, I kill the .DO. I run into memory errors if I try save the .BA and the .DO still exists. I have a program that will strip comments and extraneous spaces. I’ve already stripped the spaces. Maybe the comments will have to go too. The mazes that were made for both the Altair version and the M100 version were generated by a C program running under windows. They are not arranged in any order. In the Altair program, you select one. In M100 version, it is chosen randomly. My Altair program does not generate mazes. As an improvement, I could probably display the value of SM (selected maze) somewhere so you would know which maze you are running. However, both the location of the initial mouse position and cheese are random except the mouse starts on the left and cheese somewhere on the right. Although it can be the same maze, solving it might be different depending on where the mouse and cheese are initially located. I do not have a good method of moving tokenized BASIC to and from the M100 so I haven’t offered a tokenized version. (I use RS232 to move the .DO file). I guess I could use the CloudT to create a .BA file if it is useful to someone using Virtual T. I suspect a maze generator in BASIC would be painfully slow, but still I might try it sometime. The algorithm that is used in the C program that generates mazes is one I devised. I tried reading about other algorithms but had trouble understanding them, so I developed my own. I describe my algorithm in the documentation for the Altair MAZE029 documentation. I didn’t repeat the maze algorithm description for this program. There may be more elegant and efficient algorithms for creating mazes but what I created served its purpose. I used the same algorithm but made updates to resize the maze from 10x10 to 10x30. I also have it spit out BASIC DATA statements in addition to the DB statements. The 10x30 fits on the limited screen available for the Model 100. I don’t have a good way of rating the mazes by difficulty. If you read the documentation in the pdf file, you might have discovered the autonomous feature. By pressing the letter A (capital again), instead of an arrow key, the computer will move the mouse automatically and will continue to do so until another arrow key is pressed or it finds the cheese. The documentation describes the intelligence I gave the mouse. I am tempted to use the “right hand rule” that Ken mentioned and see if the mouse can do better than the traversal algorithm I use which involves bread crumbs. A quit or esc to return should be easy to implement. I tend to simply use control C, print the value of SM then run it again. When another maze is tried, I don’t try to reinitialize everything (clearing bread crumbs and such), but instead just use the BASIC RUN command. By pressing a capital A as the maze is being drawn, the game starts in the autonomous mode and the mouse starts moving as soon as the timer starts. Here are some metrics that I collected when the mouse runs autonomously. These were collected using an actual M100. Run Maze Seconds 1 6 227 2 2 189 3 2 305 4 6 227 5 7 96 6 5 68 7 7 70 8 7 169 9 9 303 10 4 201 11 9 241 12 1 501 13 1 859 14 4 204 15 8 108 16 5 68 17 5 168 18 0 257 19 1 512 20 6 226 21 1 68 22 6 227 23 1 501 On his first attempt, Ken managed to run the maze is 48 seconds proving its tough to beat a human. A lot of bells and whistles cost memory and as you pointed out, the size is already causing some issues. Another thought was to store the mazes as files and the user could select a file. That would free up lots of memory but might make it more of a pain to run. Thank you for the suggestions and comments. Lloyd From: M100 <[email protected]> On Behalf Of B 9 Sent: Saturday, August 3, 2024 1:43 AM To: [email protected] Subject: Re: [M100] Mouse in a Maze Nice! Well documented and well written. The only issue I ran into (and it is a minor one) is that it doesn't work on my Tandy 200 so I had to use Virtual T. 1. There is a graphical glitch in the doorways that causes pixel debris. It looks like when a horizontal line is erased to create a north-south passageway, the erasure starts two or three pixels too far to the left which cuts into the vertical wall. (See: https://gist.github.com/hackerb9/459e2192a8fcf9c4af6430598ed098ac). 2. The.DO file cannot be run because the Tandy 200 has only 24K (per bank) so there is not enough memory to store both the .DO file and create the .BA file. You may want to consider offering a pre-tokenized <https://github.com/hackerb9/tokenize> .BA file for download. If you use Github Actions, you can set it so that each 'git push' of the .DO file will automatically create a fresh .BA file. (For exampe, see the Makefile <https://github.com/hackerb9/M100LE/blob/main/Makefile> and Workflow <https://github.com/hackerb9/M100LE/blob/main/.github/workflows/release.yaml> for M100LE <https://github.com/hackerb9/M100LE/> ). 3. Only half the screen is used. . I also have a few questions. * How did you choose which ten mazes to include in the program? Are they sorted by difficulty? It might be fun to have it remember which mazes you've beaten so it will always show the next harder level. * The documentation implies to me that the Altair version of MAZE029 is able to generate new mazes because it has a C++ compiler. Is this talking about that "FUZIX <https://www.fuzix.org/> " OS I saw on your github? Would a maze generator in BASIC be too slow? Does your appearance here mean we can hope to soon see a FUZIX install image for the Model T computers? And finally, a few suggestions for the future: 1. Hitting F8, 'Q', or Esc during the game does not quit and return to the Menu, but they should. 2. It would be nice if the 'vi' cursor keys (hjkl) or WordStar movement sequences (E, S, D, X) worked in addition to the arrow keys. 3. The "Play Again?" prompt presumes CAPS LOCK is down 4. Have you considered using Ken Petit's AsciiPixels image library for drawing sprites instead of using the built-in characters? Thanks! —b9 On Fri, Aug 2, 2024 at 8:17 AM <[email protected] <mailto:[email protected]> > wrote: Hello all, I’ve created a BASIC maze traversal game for the TRS-80 Model 100. This program will randomly select one of ten prebuilt mazes and display it on the TRS-80 Model 100. The maze is 10 x 30. A mouse is located on the left side of the maze and cheese is located on the right side. The object of the game is to use the arrow keys to move the mouse to the cheese. You will be timed with the results reported when the mouse gets to the cheese. The game is found at https://github.com/LEJ-Projects/Mouse-in-a-Maze. I’ve included some documentation as well as the source and executable files for the C programs used to create the mazes. Let me know what you think Lloyd
