Javascript for Kids · Lesson

Planning the Game

Decide how the guessing game will work.

Lesson 1 of 413 steps

Planning the Game is a free Javascript for Kids lesson on CoddyKit. This is lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Javascript for Kids learning path, and your progress syncs across the web and the CoddyKit app. The Javascript for Kids course includes 4 lessons in total.

Let Us Plan a Game! 🗺️

Smart coders PLAN before they build! 🧠

Today we plan a Number Guessing game. 🎯

What Is the Game? 🤔

The computer thinks of a secret number. 🤫

You guess, and it tells you "higher!" or "lower!" until you win! 🎉

Step by Step 📋

Every game has steps. Let us list ours:

  • Pick a secret number 🎲
  • Get a guess 🙋
  • Give a hint ⬆️⬇️
  • Win! 🏆

Step 1: The Secret 🤫

First, the computer needs a secret number. We will use random! 🎰

console.log("Plan: pick a secret number 1 to 10");

Step 2: The Guess 🙋

Next, the player makes a guess. We save it in a box! 📦

console.log("Plan: player guesses a number");

Step 3: The Hint 💡

Then we compare! Is the guess too big or too small? 📏

We say "higher" or "lower" to help! ⬆️⬇️

Step 4: Winning! 🏆

If the guess matches the secret, the player WINS! 🎉🎊

Why Plan First? 🧐

Planning makes building easy! You know exactly what to do. 🗺️

Builders use blueprints, and so do coders! 📐

Drawing It Out ✏️

You can even draw your game on paper first! 📝

Boxes and arrows help you see the steps. ➡️

Our Tools 🧰

We will use things you know:

  • Random numbers 🎲
  • Comparisons ⬆️⬇️
  • if/else 🔀
  • Functions 🪄

Ready to Build! 🚀

Now we have a plan. Building will be a breeze! 😎

Great coders always plan first.

Quick Check 🧠

Question time! 🎯

Planner Pro! 🏆

Yay! You planned a whole game! 🗺️

Next, we make the secret number. Let us build! 🚀

Free to start

Learn JavaScript with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
35
Lessons
140

Frequently Asked Questions

Is the “Planning the Game” lesson free?

Yes — the full text of “Planning the Game” is free to read here on the web. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Javascript for Kids course, upgrade to CoddyKit PRO. The Javascript for Kids course includes 4 lessons in total.

What will I learn in “Planning the Game”?

Decide how the guessing game will work. You practise Javascript for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Javascript for Kids?

No prior experience is required. Javascript for Kids on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 1 of 4.

How long does the “Planning the Game” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Javascript for Kids lesson?

Yes. Every Javascript for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Planning the Game
  2. Making the Secret Number
  3. Checking the Guess
  4. Winning the Game
← Back to Javascript for Kids