Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

What You'll Build

Every great chef starts with a simple, rewarding recipe. By the end of this guide's core concepts, you won't just know theory—you'll have built your very first interactive program from scratch.

Welcome to the Secret Ingredient Challenge!

It's a fun game where you, the master baker, must discover the perfect baking temperature for a rare and mysterious ingredient. The computer will think of a secret temperature, and it's your job to guess it before you run out of ingredients!

Each time you make a guess, the program will give you feedback:

  • "Too cold! The cake is gooey."
  • "Too hot! The cake is burnt to a crisp!"
  • "Perfection! The cake is golden-brown and delicious."

The Skills You'll Learn

This project isn't just for fun; it's a practical test of all the core "kitchen skills" you'll learn in this guide. To build this game, you'll master how to:

  1. Store Information: You'll use variables to keep track of the secret temperature and the number of guesses you have left.
  2. Talk to the User: You'll learn how to get user input by asking the player for their guess.
  3. Make Decisions: You'll use if/else logic to check if the guess is too high, too low, or exactly right.
  4. Repeat Actions: You'll use loops to allow the player to keep guessing until they win or run out of attempts.
  5. Use "Kitchen Gadgets": You'll import a code library to generate a new random temperature every time the game is played.

It might sound like a lot now, but don't worry. Each concept in the coming modules is another tool for your kitchen. We'll guide you through every step, and by the end, you'll have a finished project that proves you can think like a programmer.

Ready to preheat the oven? Let's get started.