4.* Advanced
Undoing
Page 100, exercise 12 - the robot that has the undo command. I used the idea of a Decorator strategy.
Simultaneous Action
Chapter 8 in the text shows how to make more than one robot act at the same time. See the MultiThreadBot on the class GitHub.
A brief summary is:
-
World.setupThread(robot)
prepares the robot to act in its own thread. -
World.startThreads()
calls therun()
method for every robot that is set up as threading using the command above.