All right. So up till now,
our game is not actually particularly fun and it's because we haven't enabled the
repeatability.
So we need our game to allow the user to guess the next letter and the next
letter
and keep going until they either die or they get to the solution.
So in this case, the solution is ardvark.
So I'm gonna guess a letter, a,
and that gets replaced in the correct positions.
And now I'm allowed to guess again.
And I'm going to keep going until I've filled out all of the characters.
So I'm almost there just need a 'k' now
and we should complete the entire game.
And it tells me that it's complete and that I've won
and the game finally ends and exits out of the loop. In order to achieve this and
make our game more like a game, we have just one to-do.
Now,
the idea here is you're going to use a while loop to let the user guests again
after they've guessed before. Now the loop should only stop
once the user has guessed all of the letters in the chosen word,
and this means that the display list should have no more blanks in it.
And then at that point,
you can tell them that they've won. Now in order to do this,
and as a quick hint, you might need to have a read of, again,
the section which I'll link to in the course resources. And specifically,
I want you to focus on this 'in' key word,
because we mentioned it previously in the course only briefly.
So I want you to read through this part and see how that works,
because you'll need it in order to get this to work. Now,
the other thing to remember is that you have the negation in Python.
So you can say,
if something is not true and then to do something or other.
So the not is the negation and this basically flips whatever is here.
So it could be, um, a = 3.
If not a > 1.
So in this case, a is three, three is greater than one. So this becomes true.
But because there's a not in front of it, then this entire thing becomes false
and so this if statement won't be carried out in this case.
But if this was zero and zero is not greater than one,
so this is now false and not false becomes true
and now this if statement will be carried ouit.
So that's how you use the negation. And finally,
you might need to remind yourself of what we learned in yesterday's lessons and
how the while loop works. Essentially,
you want to be able to get this part to repeat itself again and again and again,
until
all the blanks in the display is gone and they're filled.
And at that point, the user has won. And remember,
you don't have to worry about punishing the user for wrong answers just yet,
we're going to do that in the next step.
But for now, focus on this one to-do and see if you can solve this challenge.