Now that you've completed some of the scoping problems, it's time to tackle
the final project.
This final project is a little bit special because now I think you've got enough
experience and enough skills under your belt to actually create this project
entirely from scratch by yourself. So you're flying solo now.
Now the first thing I want you to do is head over to guess-the-number-
final.appbrewery.repl.run
and I want you to play this game quite a few times actually,
just so that you get a good idea of how it works. Now,
the first thing it tells us is Welcome.
And then it tells us it's thinking of a number between 1 and 100,
and then we get to choose a difficulty. So I'm going to choose hard.
Now it tells me that I have five attempts to guess the number,
and I'm going to make a guess.
Now it tells me that 50 is too high, it's not the number that it was thinking,
and I have to guess again. And notice how I started out with five attempts,
I'm now down to four attempts. So let's try 25.
So 25 is too low, but 50 is too high.
So that means the number is somewhere in between them.
Let's try 30. Again, too low. Let's try
4o. Too high. Maybe it's 45.
But I only have one attempt left
cause I went for the hard level. And as expected,
I didn't manage to get the right number and I've now run out of guesses.
So I've lost. If we run again,
we can try playing this on an easy level.
On an easy level, we get 10 attempts instead of 5.
That gives us a little bit of extra opportunity.
So let's try 50. 50 is too high. 25 is too high. 10,
10 is too low. So it's between 10 and 25. So let's try 15.
Now, if 15 is too high, but 10 is too low,
then we're pretty close to the answer.
It's now between 12 and 15, let's try 13, 14.
There we go. The actual answer that it had in mind was 14.
And I had four attempts remaining to get the final answer and I managed to get
it at the end. Play through this game at least three,
four times on the different levels
and remember that the easy level has 10 gos,
the hard level, the user gets 5 gos
at guessing the number. And look at how the code works and how it's functioning.
And then I want you to break down this problem. Write a to-do list,
create your own list of tasks that you need to solve and start with the simplest
one. And once you've tackled that, start putting in some comments into your code.
Write down the functionality your program needs,
and then write the code and then test out your code and keep going until you've
tested it and made sure that it works in all situations.
So this final project has no starting code.
I'm not going to give you any comments or to-dos to start off with.
I want you to try and tackle this entire project by yourself.
And the only thing I'm going to give you is this link so that you can try out the
final project. And I know that there's a lot of ways that you can cheat,
but don't do it. Have faith in yourself. If you tackle this for an hour,
I'm pretty sure you're going to get there in the end.
You have free reign on the styling or the wording,
whatever it is you want it to say.
But it has the have the same functionality. Now
this also means that if you want to get some ASCII art of your own,
then you can head over to this website
which I'll link to in the course resources and just type the name of your game.
So maybe it will be Guess
The Number.
And you can change the font that you want for it.
Maybe something a little bit isometric or maybe ogre,
or maybe train, whatever it is you want.
And then once you're happy with the font,
you can select and copy everything that's on there,
and then inside your project
you can create a new file called art.py and then create a new variable and set
it equal to the design that you've got in mind. Now,
in order for it to look right, you actually have to create this as a docstring,
so three quotation marks to begin with and then three quotation marks to end.
And then just make sure you have enough horizontal space to display the whole
thing in one go instead of it being truncated
when you have a little bit of space and you should be able to see the actual
design.
Pause the video now and create this number guessing game by yourself
as the final project.