Fun AI Program for Pathfinding with A Rat in A Maze

Basic and Machine Language

Moderator: Moderators

Post Reply
Forbidden64
Vic 20 Hobbyist
Posts: 146
Joined: Sun Feb 28, 2016 9:59 pm
Location: CA USA

Fun AI Program for Pathfinding with A Rat in A Maze

Post by Forbidden64 »

[Edit: needs at least +8K. Another thing I noticed is that you have to delete the crappy test maze on the disk manually before you can save yours. Don't use the test maze because it has no start point, and will cause an error. Type open15,8,15,"s0:maze":close15 . After that you can save your own maze to disk.]

I was browsing around DLH's commodore page again and he has a new addition for the VIC-20. It is called 'Compute's Vic-20 Collection'. I was intrigued, I already had laser printed and comb bound all the other compute volumes for the VIC a few years ago, and hadn't even heard of this volume before. No wonder...it came out in 1985, and what few copies are available on amazon are going for an outrageous $86 US(+ shipping). Anyway, while I was typing in a few programs, I came across this neat little AI program. It simulates a rat in a customizable maze(which you can save to disk). It is just too much fun, and demonstrates a whole bunch of different pathfinding code techniques. It also has several modes. After the rat has figured out his way to the 'cheese" it can remember how to get there and can do so with some decent speed! Pretty impressive. Anyway, it took me 6 hours or so to get the darn thing working. I would have been better off if I typed it manually using proofreader, which is what I eventually did.

I would have liked to include the text from the book here, but the OCR on that thing is so terrible! So, I'll just include a link to the book itself. The description starts on page 220 (230 in PDF reader)
Otherwise, the code is not commented, and would be difficult to figure out what it is doing etc.

http://69.60.118.202/books/vic20/Comput ... ection.zip

And... the program is attached! Enjoy! I think this is just a fun application regardless. Just the fact that he gave the rat a tail and everything is a riot.
Attachments
Rats.zip
(4.97 KiB) Downloaded 144 times
Post Reply