This podcast is about a little programming exercise I learned in my first programming class. The idea is to generate a random text-based maze and make mouse ('@') search the maze systematically to find the cheese ('V'). If it does so before it runs out of energy (moves) it wins ('$' == happy mouse). Otherwise it starves ('%' == dead mouse).
You can find my git repos for the Raspberry PI code including this program at these locations:
The Mouse-in-a-maze program also requires the catlib library as well which is at:
You may note that these directories are different from those in my previous RPI episodes. The repositories used to be on gitorious. However since gitlab acquired gitorious, I have migrated the repositories. They currently live on both github and gitlab and I have pushing updates to both for the time being. So I have been waffling about which one will be the ultimate master for these projects. But since, I am doing most all the work on this code myself, it doesn't much matter for the time being.
If this is your first time playing with bare metal programming in the RPI you can get more info and tips from HPR episodes 1619, 1630 and 1666. Note that the gitorious links in those episodes are outdated as mentioned above. The github links therein should still be fine though.
The mouse code itself is in the apps/mouse0
directory. If you haven't played with this environment before you'll need to do the following:
Once those prerequisites are taken care of you can:
/path/to/catrpi/apps/mouse0
type make
to buildmouse0.bin
to send.These pages describe VT100 Terminal codes:
Sample traversal:
########################################
#+0****## #+#...###...#..$ ## # # #
##+###+## #+++......#...# ## # #
# #.+++++#....# # # # # #
# #+++++#+.+..# # # # #
# #.##.+++#+.### # # # ## #
# ###.+.##++.## # ### # # #
####+.#..#++#.## # ##### ## #
#++#.#.###+.## ## ## # # #
#++++++.##.++.# # ## # # # # ##
#+++++#..##.## ## # #### # # ##
#+.....#..#. ## # # ## ## #
#+..+....... # # # # ## #
#+...#..### # # # ## ##
#.#..#.........# # # # ##### # # ## #
#.......## ##.... # ### ## #
##......# ## ##..# ##### # #
#.+.#...### ###. ## ## # ##
##.+...# # #### # ## # #
########################################
Mouse found the cheese! :) Press any key to restart!
Unless otherwise stated, our shows are released under a Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.
The HPR Website Design is released to the Public Domain.