Ricochet Robot Solver Code
Status: Pre-Alpha
Brought to you by:
jingy
File | Date | Author | Commit |
---|---|---|---|
boards | 2011-07-09 | jingy | [r1] This is the initial import of an unpolished ver... |
images | 2011-07-09 | jingy | [r1] This is the initial import of an unpolished ver... |
Assets.py | 2011-07-09 | jingy | [r1] This is the initial import of an unpolished ver... |
Gui.py | 2011-07-10 | jingy | [r6] Added more diagnostic outputs. |
README.txt | 2011-07-09 | jingy | [r2] Adding a README file. |
Solver.py | 2011-07-10 | jingy | [r5] Added the number of explored positions to output. |
This directory contains a BFS implementation of a solver for Ricochet Robots. The files and directories are as follows: Assets.py -- contains code for the basic data structure that represents the game. Solver.py -- contains the Breadth First Search implementation of the game playing software Gui.py -- contains the wxPython based GUI code for displaying the board as well as invoking Solver.py to search for the moves. boards/ -- contains testing boards. images/ -- contains images for the tile, the colours, the robots, and the symbols. To see the solver in action, do: python Gui.py boards/board1.txt images This will bring up a GUI. You can manually move the robots according to the rules of the game by first left clicking on a robot, then moving them using the 4 directional keys on your keyboard. If you left click on a symbol, the Gui code will assume that you want the corresponding robot to move to that symbol, and it will invoke the solver code to calculate all the shortest paths. Only the first shortest path will be animated. After you have clicked on a symbol and finished the animation. You can then move the symbol around with the 4 directional keys on your keyboard. The artwork used in the board is absolutely pitiful, so you are welcome to change them. The 4 robots are tiles with the letter "RB" (for Red Robot), "GB" (for Green Robot), "BB" (for Blue Robot), "YB" (for Yellow Robot) and "SB" (for Silver Robot). The symbols are "M" for "Moon", "S" for "Sun", "P" for "Pyramid", "C" for "Cross", and "V" for "Vortex". Vortex has no colour and therefore can be used by all the robots. The symbols and robots are 48x48 png files that havev the symbol/robot colour painted on a transparent background. The tile is a 64x64 png file. If you want to draw your own artwork, you don't have to stick to the dimensions, but the file names must be kept.