1
00:00:00,230 --> 00:00:04,640
Well done for getting to step 4. Now in this step

2
00:00:04,700 --> 00:00:07,310
when you take a look at the starting file,

3
00:00:07,340 --> 00:00:11,390
you'll see that I've incorporated a bunch of ASCII art,

4
00:00:11,420 --> 00:00:15,050
so art that's created using strokes of the keyboard.

5
00:00:15,560 --> 00:00:20,560
And you can see that this represents the stages of our hangman game starting from

6
00:00:20,930 --> 00:00:25,790
where they have all six lives and then going down in lives until they have

7
00:00:25,850 --> 00:00:28,970
no more lives, where the hangman character is complete.

8
00:00:29,630 --> 00:00:33,710
This has been included as a list and inside the list

9
00:00:33,860 --> 00:00:36,980
each of these pieces of art is a single string.

10
00:00:37,040 --> 00:00:40,610
So we're going to be printing it out in this step,

11
00:00:40,730 --> 00:00:44,000
and we're going to be using it to give the user feedback.

12
00:00:45,080 --> 00:00:49,670
So the to-dos for step four include creating a variable called lives to keep

13
00:00:49,670 --> 00:00:54,670
track of the number of lives and lives should be equal to six.

14
00:00:55,760 --> 00:00:57,080
Now in the next to-do,

15
00:00:57,380 --> 00:01:02,120
we're checking to see if the guess is actually not a letter in the chosen word,

16
00:01:02,420 --> 00:01:05,480
then we're going to reduce that variable lives by one.

17
00:01:05,840 --> 00:01:09,020
So eventually it's going to step down all the way to zero.

18
00:01:09,230 --> 00:01:13,940
And when that happens, the game should stop and it should print "You lose."

19
00:01:14,420 --> 00:01:18,950
Now, this part is really important because we want the game to stop

20
00:01:18,980 --> 00:01:21,620
when the lives has gone down to zero.

21
00:01:22,040 --> 00:01:26,120
So the code should exit the while loop and print "You lose."

22
00:01:26,330 --> 00:01:29,780
So in addition to winning as a condition to ending the game,

23
00:01:30,050 --> 00:01:34,070
losing is also a condition for ending the game. Now,

24
00:01:34,070 --> 00:01:38,360
the final to do is just to print the ASCII art from stages

25
00:01:38,360 --> 00:01:40,160
which is this list up here,

26
00:01:40,610 --> 00:01:44,360
and the stage should represent the current number of lives

27
00:01:44,360 --> 00:01:46,790
the user has remaining. So this way,

28
00:01:46,790 --> 00:01:50,300
when we actually play the game and we get all the letters wrong,

29
00:01:50,810 --> 00:01:55,810
each time a new piece of the hang man is going to be drawn until eventually we

30
00:01:56,060 --> 00:02:01,060
end up with the entire drawing complete and the game ends,

31
00:02:01,400 --> 00:02:05,450
and it tells us that we lost. If it's helpful,

32
00:02:05,480 --> 00:02:08,389
refer to the flow chart. And once you're ready,

33
00:02:08,419 --> 00:02:12,110
go ahead and fork the starting code and tackle the

34
00:02:12,110 --> 00:02:15,950
to-dos one by one. Good luck and I'll see you on the other side.

