What you'll build

  • Choose a random number from 1 through 100.
  • Respond with higher, lower, or correct.
  • Count guesses and support a new game.

Your building plan

  1. Generate and store one secret number.
  2. Ask the player for a guess.
  3. Validate that the guess is in range.
  4. Compare the guess and display a helpful message.
  5. Reset the secret and guess count for a new game.

Start with a small prototype

13px
main.jsYour ideas, in code.
Loading your editor…
Run your code to see the output here.
Ready to buildUTF-84 lines

Share your project with the world

The finished project is a complete HTML file. Download it and open it in a browser to explore the interface and its JavaScript.

  1. Move your interface into an index.html file and your logic into script.js.
  2. Test keyboard controls, small screens, and empty or invalid inputs.
  3. Commit your files to a new repository without any secrets.
  4. Choose a static hosting service, connect the repository, and deploy the project.
  5. Open the published URL on another device and try the complete flow.