Ages 8β10
Write actual JavaScript β variables, for loops, if/else, and arrays β and watch every line animate.
Your First Variable
Typing the same number over and over is boring β and if you want to change it, you have to change every line. Programmers store numbers in a box with a name. That box is called a variable.
Badge: π Variable Keeper
Loops: Do It Ten Times
A penguin has to waddle across the whole ice sheet. Writing 10 move lines is slow. A for loop says: 'do this 10 times' in one line.
Badge: π Loop Learner
Using the Counter
The loop counter i isn't just for counting β you can use it inside the loop. Watch a kangaroo take bigger and bigger hops as i grows.
Badge: π Counter Coder
If / Else: Making Decisions
A fox reaches a river. If it has enough energy it leaps across; if not, it stops for a rest. Code can choose between two paths using if and else.
Badge: π Decision Maker
Arrays: A List of Animals
One variable holds one value. An array holds a whole list β perfect for a parade of animals you can march through with a loop.
Badge: π List Master
While: Keep Going Untilβ¦
Mission control counts down from 5 to 1, then launches. A while loop keeps repeating for as long as something stays true.
Badge: π Countdown Coder
Random: A Race Nobody Can Predict
Two racers, and even you don't know who wins. Math.random() gives a surprise number every time you press Run.
Badge: π Chance Coder
Climb a Staircase
A bird climbs an invisible staircase: a bit forward, a bit up, again and again. Two commands inside one loop make a zig-zag pattern.
Badge: π Pattern Builder
Even or Odd Stripes
A car drives through the paint shop again and again. On even trips it comes out red, on odd trips blue. The trick is the remainder operator %.
Badge: π Remainder Rookie
Traffic Light Logic
A car obeys a traffic light. Red means stop, yellow means get ready, green means go. Three possible answers means you need else if.
Badge: π Logic Driver
Grow, Shrink, Repeat
A tree breathes: it grows, grows, then shrinks back. Loops don't just move things β they can change size, colour, and anything else.
Badge: π Cycle Coder
Project: Obstacle Course
Time to combine everything. A rabbit must cross an obstacle course: it hops the rocks, sprints the straights, and celebrates at the finish.
Badge: π Course Builder