Write a multithreaded program to implement the following arcade game: A river has logs floating downstream (or to and fro). A frog must cross the river by jumping on logs as they pass by, as illustrated in Figure 8.16. The user controls when the frog jumps, which can only be perpendicular to the riverbanks. You win if the frog makes it to the opposite side of the river, and you lose if the frog lands in the river. Graphical output is necessary, and sound effects are preferable. Concurrent movements of the logs are to be controlled by separate threads. [This problem was suggested and implemented for a short open-ended assignment (Problem 8-30) by Christopher Wilson, a senior at University of North Carolina at Charlotte in 1997. Other arcade games may be amenable to a thread implementation.]
Figure 8.16
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here