Lab 13: (4 points) Color used only twice, Requires Lab 12
First, you should edit your Box class's instance variable of showColor to (temporarily) be true by default (if it is not that way already). This way we can see the colors and thus if our code is really working
For this lab, in the setNewGame method, you need to
while the color picked has already been used twice - get another random number (color)
showColor's default back to false so the boxes start all gray.
The only thing left in coding the game is to actually play the game. Think about how it is played and what is left to do. Everything left can be done in one new method called playGame(Box newestClicked) which we will do in the next project to finish.
Remember that at any given time while playing the game, we (computer memory) only need to know about two boxes at a time since once they are not the same, they are flipped back. Hmm, how might you store these boxes that you need to temporarily remember?
Think about it since you will need to do it in the next/last lab.
Lab 14: (4 points) - Play Game!
To GuessGame.java, add the method playGame(Box newestClicked) which will be called after the identification of the box clicked is made.
Specifically, it should be called at the end of the mouseClicked method between the invocations of boxChoice.picked(); (the box needs to know it is chosen) and repaint(); (we want to repaint when we have decided what should happen).
This way, the newest Box clicked has been identified, and we can process some information before we display all the boxes again.
Remember that the game is played by the squares staying shown when they are matched, and flipping back if two do not match. For more information/help on this last method make sure to read the last lesson. Feel free to add any extras (how many clicks to win, reassurance, etc.).
Finally, make an html page to display the applet and show me your lab by going to your website.. The html page should have: