Project: Guessing Game (Part 1)
In our last project, we built a simple calculator. Now, we're going to start a new, slightly more complex project that we will build over the next few articles: a classic guessing game.
In our last project, we built a simple calculator. Now, we're going to start a new, slightly more complex project that we will build over the next few articles: a classic guessing game.
In Part 1 of our Guessing Game project, we set up the project and generated a random secret number. Now, it's time to add the core logic of the game: getting the user's guess and comparing it to the secret number.
Welcome to the final part of our Guessing Game project! In Part 2, we added the core logic for comparing the user's guess to the secret number. In this article, we'll add the final polish to our game by handling invalid input gracefully and improving the looping mechanism.