Game Development Reference
To know whether the player has won or lost, the game first needs to know a few more things:
How many guesses the player has remaining before the game finishes.
How many guesses the player has made. This is actually optional information, but interesting to
implement so you'll give it a whirl.
When a program “needs more information” about something, it usually means that you need to cre-
ate more variables to capture and store that information. That's exactly what you'll do in this case:
create two new variables called cqaooaoNai]ejejc and cqaooaoI]`a. You'll also create a third variable
called c]iaOp]pqo that will be used to display this new information in the output text field.
1. Add the following code in bold to your program. The code that adds the new variables is pretty
straightforward, but be very careful when adding the new code to the kjCqaoo>qppkj?he_g
method because there are many new things going on there that you haven't yet seen.