WEBVTT

00:00.630 --> 00:08.900
So no it's go through hangman and try to understand everything we need for so it says create a program

00:08.950 --> 00:17.830
hangman and prompt the user to enter a phrase that phrase will be hidden by a series of dashes.

00:18.030 --> 00:32.010
So already we need we need a way of storing and we'll call it the secret phrase.

00:34.450 --> 00:47.270
And it's phrase not word because it could have like spaces between say and we'll also need the kind

00:47.270 --> 00:54.470
of hidden phrase the one that's hidden by the dashes and that I think that I'll have to be separate

00:54.650 --> 01:00.260
from the secret phrase for reasons we'll get into in a second.

01:00.290 --> 01:07.980
So we need a way of storing let's say the hidden phrase

01:10.870 --> 01:13.490
and with dashes

01:16.730 --> 01:19.330
and again it says excluding spaces.

01:19.330 --> 01:20.320
Right.

01:23.240 --> 01:26.650
So the player can then guess letters.

01:26.700 --> 01:33.910
And if the guests if they guessed correctly all the letters that match will be revealed.

01:34.120 --> 01:34.680
OK.

01:35.560 --> 01:44.090
If they guessed incorrectly then one more bony part will be added to the gallows.

01:44.230 --> 01:51.180
See here it says lose Gallo's should look like this.

01:51.610 --> 01:55.420
So the gallows is where they hang the guy.

01:55.810 --> 02:01.410
And you'll notice that there are six body parts.

02:02.350 --> 02:10.230
So this really means that if they lose and they only have they only had six tries to begin with.

02:10.230 --> 02:24.470
So you need a variable that holds the number of guesses left.

02:26.010 --> 02:26.480
Right.

02:26.820 --> 02:37.800
And set to six initially.

02:37.810 --> 02:44.900
So how many guesses they have left is how many body parts there will be ultimately six in this case.

02:46.330 --> 02:53.920
If the player loses the word should say phrase should be revealed.

02:54.310 --> 03:00.240
And after the game's over the players should be prompted if they want to play again.

03:00.530 --> 03:03.300
It's just like numbered Esser.

03:03.420 --> 03:11.070
So really there's not too much stuff we need to go through with this one but we used to know that we

03:11.400 --> 03:22.800
need to store the secret phrase and also a hidden phrase because we need to be able to check if the

03:22.800 --> 03:28.580
letter matches one of one of the letters in the secret phrase.

03:28.650 --> 03:31.220
Can't do that with just all dashes right.

03:32.200 --> 03:38.980
So that's kind of why we need two different phrases here.

03:39.160 --> 03:41.620
Is this because of this line here.

03:43.720 --> 03:46.380
So it's pretty straightforward.

03:46.450 --> 03:52.140
And in the next lecture we will actually do the top down design of hangman.
