Lab #9: Getting Started on Project 3 Get the various points in this lab checked off by a TA by the last lab of Tuesday, 20 November. 1. If you have not already done so, create a subdirectory for project #3, and copy in the files from ~cs61b/hw/proj3. Check that you have the file amazons.prj. 2. Perform an initial prcs populate prcs checkin to get your project under source-code control. We are going to start the project by trying to get something working that you are NOT called upon to implement: a version in which you play yourself, typing in moves for BOTH sides. Initially, we won't implement remote play (in which each player runs in a separate Java program). 3. Examine the Player and HumanPlayer classes. Try to understand their intended operation. Also find and look over the documentation for the ucb.util.mailbox.Mailbox interface and the ucb.util.mailbox.QueuedMailbox class. A Finger Exercise - ------ -------- 4. Modify amazons.java so that it simply A. creates Mailboxes (QueuedMailboxes) with which two Players of any type can communicate with each other, B. creates two HumanPlayers that are set up to communicate with each other using those Mailboxes. C. primes the two Mailboxes to tell one of the HumanPlayers to be red and the other to be blue. D. Starts the two HumanPlayers. E. Waits for them to finish (take a look at the documentation for the 'join()' method on java.lang.Thread.). 5. Modify HumanPlayer.java. To start with, implement a myMove () method that immediately resigns. 6. Modify Player, filling in reportMove and reportWinner. 7. Compile and test your program. Getting HumanPlayer to work ------- ----------- -- ---- 8. Now modify HumanPlayer.myMove to prompt for and read moves from the standard input, check them for legality (repeating until receiving a legal move), and return them. 9. For the time being, just have gameOver end the game at, say, the fifth move. 10. Test what you have so far. Useful Debugging Output ------ --------- ------ 11. Extend HumanPlayer so that the command 'board' will cause print-out of the board in some readable format. This is useful for debugging, even if it isn't included in the project spec, and also useful for people actually using the text interface to play the game. If you create a static method that takes a board as its argument, then you can call it from GJDB when debugging, which can be very useful. End of Game --- -- ---- 12. Implement Player.gameOver for real. How would you test this? Show what you have to your TA for checking off.