The actual algorithm works great!
The robot, on the other hand...
Here is a video of the robot's first attempt at winning the game:
It did not go well. Even though the robot knew internally where to go, its movement was too imprecise to go to its intended square, so where it thought it was became misaligned from where it actually was.
The spinning at the end is most likely from one of the motors turning too slowly for the wheel to actually move.
After this, we tried fixing the movement as best as we could. By the end of the last session each movement direction was being tested, edited, and reconstructed separately; unfortunately, there was not enough time left to be successful.
Here is the robot's final run, attempting to go forward three spaces:
The robot, alas, was not successful.
Out of all of the teams, only two decided to run their robots during the robot roundup. They both managed to complete the simple puzzle, but could not complete the harder one.
If we were to do this project again, we would need to prioritize movement code first. Even though the robot's ability to move was tested relatively early on, the code to go to adjacent squares was developed far too late for it to be tested properly. Furthermore, the means of getting the robot to re-align itself would have to be thought out in much greater detail.
The algorithm could also be made more efficient by being able to figure out the gold space's location earlier and by being able to navigate directly to the gold. This would lower the number of squares the robot must traverse.