Planning the Game
Decide how the guessing game will work.
Planning the Game is a free Javascript for Kids lesson on CoddyKit — 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, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
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! 🚀
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, and the Javascript for Kids course includes 4 lessons in total. 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.
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; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
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
- Planning the Game
- Making the Secret Number
- Checking the Guess
- Winning the Game