I want to formally go over e design approach that we've actually done before in the first game.
It's called top down design.
It's an approach that takes a problem and breaks it down into smaller problems.
Then we take the smaller problems and break them down and so on.
So the way I like to think that is this way.
So we first solve the problem in a high level way.
So for a number Yessiree if you remember I did something like this.
While this is an actual code this just kind of pseudo code to in
in is said in here it's like play a game or something right.
So here this is a very high level of abstraction but it solves the entire problem.
Right.
You do play the game while you want to play again.
Right.
So this kind of solves the entire problem but there's no detail.
And so this is a very like I said high level of abstraction then what you do is whatever step you can't
write it like concretely like actual code for example like this is an actual code is a whole bunch of
steps right.
We take these these steps and break them down even more.
So for example I'd have some kind of play game
this and this isn't code.
And how would you play the game.
Well maybe you initialize the game for us.
And then you go through the game say do while again while the game is over say game is over.
And inside the while loop you say maybe get the input or maybe prompt the user for something prompt
the player maybe
and you get the input and then you maybe update the game somehow and then you draw the game say
so these are all just high level steps that you can have and then we're not quite done.
We have still the want to play again.
We've already done this before but just for completeness sake.
A An you would say prompt easier.
But it's
in return true.
The user wanted to play again.
OK so you're just high level steps.
So notice that here this solves the problem at this level of abstraction.
So this very first step solves the entire problem.
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
play again or step two.
Right.
And then you'd break the problem down even in two more steps.
Step Three.
Break down all of that.
So initialize the game prompt the user for input get the input of the game draw the game.
Cetera right.
So you kind of break all these down into into step three.
Same with want to play again you'd break prompt the user.
Break down get the input and then break down.
Return true.
These are one to play.
Right.
So and then each one of these will become a function.
So this is a function like we did before and number Gessner.
So this would be a function and then this would be a function.
And you just keep breaking things down until you can actually write it concretely into actual steps
of code.
So once you've kind of done all of these steps then you would go back and just make these functions
and then write all the concrete code in one of the later steps.
And just like we did with number Gasser it's all kind of this is what we're going to do with hangman
next and we'll do it right after we actually go through the problem itself.