or try the following applet: The Tortoise and the Hare Race
Look at the example problem 13.17 on page 728 of the Deitel textbook. This problem is
to implement a "tortoise and hare" race in which the tortoise and the hare are
each controlled by a thread. The rules for the moves of the tortoise and the hare are
described in problem 5.41 on page 279. You should simulate the race generating moves as
described here, except that instead of printing out the progress of the race, you should
have an applet visualization of the progress of the race. You can draw the racecourse in
the applet window and show the progress of the tortoise and the hare at each clock tick.
Note that you will need to synchronize the threads with wait and notify so that neither
thread goes past one tick of the clock until the other thread is ready, too.