Exercise - Create a guess the number game

Completed

In this exercise, you build a classic Guess the Number game. The computer picks a secret number, and the player keeps guessing until they get it right. You practice using a while loop to repeat actions, if, else if, and else to compare values, and break to exit the loop when the player wins.

Launch the exercise and follow the instructions.

Screenshot of the button that launches the guess the number game exercise in a new browser tab.