WEBVTT

00:00.780 --> 00:06.720
I want to formally go over e design approach that we've actually done before in the first game.

00:06.900 --> 00:09.660
It's called top down design.

00:09.870 --> 00:15.920
It's an approach that takes a problem and breaks it down into smaller problems.

00:16.110 --> 00:21.090
Then we take the smaller problems and break them down and so on.

00:21.090 --> 00:24.440
So the way I like to think that is this way.

00:24.510 --> 00:29.180
So we first solve the problem in a high level way.

00:29.190 --> 00:34.970
So for a number Yessiree if you remember I did something like this.

00:35.170 --> 00:43.370
While this is an actual code this just kind of pseudo code to in

00:47.830 --> 00:52.350
in is said in here it's like play a game or something right.

00:53.330 --> 01:02.770
So here this is a very high level of abstraction but it solves the entire problem.

01:02.930 --> 01:03.470
Right.

01:03.530 --> 01:08.330
You do play the game while you want to play again.

01:08.410 --> 01:08.970
Right.

01:09.230 --> 01:12.770
So this kind of solves the entire problem but there's no detail.

01:12.830 --> 01:23.160
And so this is a very like I said high level of abstraction then what you do is whatever step you can't

01:23.160 --> 01:32.040
write it like concretely like actual code for example like this is an actual code is a whole bunch of

01:32.040 --> 01:33.510
steps right.

01:33.720 --> 01:38.400
We take these these steps and break them down even more.

01:38.400 --> 01:41.430
So for example I'd have some kind of play game

01:45.490 --> 01:48.500
this and this isn't code.

01:48.850 --> 01:50.890
And how would you play the game.

01:50.900 --> 01:56.210
Well maybe you initialize the game for us.

01:57.320 --> 02:11.300
And then you go through the game say do while again while the game is over say game is over.

02:13.380 --> 02:24.380
And inside the while loop you say maybe get the input or maybe prompt the user for something prompt

02:24.380 --> 02:25.300
the player maybe

02:30.890 --> 02:39.250
and you get the input and then you maybe update the game somehow and then you draw the game say

02:42.820 --> 02:53.070
so these are all just high level steps that you can have and then we're not quite done.

02:53.070 --> 02:56.910
We have still the want to play again.

02:56.960 --> 03:01.740
We've already done this before but just for completeness sake.

03:01.930 --> 03:11.800
A An you would say prompt easier.

03:11.910 --> 03:12.720
But it's

03:16.220 --> 03:18.450
in return true.

03:19.670 --> 03:24.300
The user wanted to play again.

03:24.410 --> 03:26.630
OK so you're just high level steps.

03:26.750 --> 03:32.110
So notice that here this solves the problem at this level of abstraction.

03:32.120 --> 03:36.350
So this very first step solves the entire problem.

03:36.350 --> 03:49.270
And then this this is kind of step two so me just say Step 1 and step 2 both play a game and want to

03:49.270 --> 03:50.550
play again or step two.

03:50.550 --> 03:51.100
Right.

03:51.370 --> 03:56.360
And then you'd break the problem down even in two more steps.

03:56.700 --> 03:57.600
Step Three.

03:57.600 --> 04:00.250
Break down all of that.

04:00.320 --> 04:08.310
So initialize the game prompt the user for input get the input of the game draw the game.

04:08.360 --> 04:09.340
Cetera right.

04:09.480 --> 04:15.260
So you kind of break all these down into into step three.

04:15.320 --> 04:18.980
Same with want to play again you'd break prompt the user.

04:19.000 --> 04:22.210
Break down get the input and then break down.

04:22.450 --> 04:23.280
Return true.

04:23.290 --> 04:24.260
These are one to play.

04:24.400 --> 04:25.060
Right.

04:25.090 --> 04:30.190
So and then each one of these will become a function.

04:30.190 --> 04:34.080
So this is a function like we did before and number Gessner.

04:34.290 --> 04:37.430
So this would be a function and then this would be a function.

04:37.900 --> 04:44.050
And you just keep breaking things down until you can actually write it concretely into actual steps

04:44.050 --> 04:47.060
of code.

04:47.110 --> 04:55.180
So once you've kind of done all of these steps then you would go back and just make these functions

04:55.180 --> 04:58.900
and then write all the concrete code in one of the later steps.

04:58.910 --> 05:05.740
And just like we did with number Gasser it's all kind of this is what we're going to do with hangman

05:05.740 --> 05:11.910
next and we'll do it right after we actually go through the problem itself.
