How to make a strong coder, not a block-copier
Most kids get stuck on tutorials: they follow the steps, it works, and they learn very little. Five habits make the difference. Use them at every level.
Tools: makecode.microbit.org in Blocks view, the on-screen simulator, his micro:bit V2.2, the Cutebot Pro and the Keyestudio 37-in-1 kit.
1. Use, modify, create
- Use: run a small program and predict what it does first.
- Modify: faster, reversed, two players, a different sensor.
- Create: build something new with the same idea, from a blank project.
Step 3 is where the learning happens.
2. Predict before running
Before every download ask: "What do you think will happen?" A wrong guess is valuable. It shows exactly what he doesn't understand yet.
3. Plan on paper (from Level 3)
- What should it do? One sentence.
- What does it need to remember? These become variables.
- What events happen? Buttons, shake, timers, radio.
4. Debug like a detective
- Read the code out loud to a stuffed animal.
- Shrink it: remove blocks until the bug disappears.
- Show the value with
show numberorserial write. - Slow it: add a pause or use slow-motion.
- Then ask for help, and say what he tried.
5. Explain it back
After each project he teaches it to you in two minutes. If he can't explain a block, he doesn't own it yet.
Your role as coach
- Don't touch the mouse. Ask questions instead.
- Praise debugging, not only finished projects.
- Let him be stuck for 10 minutes before a hint.
- Keep a project notebook: date, project, one bug he fixed and how.
Programs are instructions, events start them
Big idea: the computer does exactly what you say, in order, and only when something triggers it.
- Animated heartbeat: big heart, small heart, repeat.
- Name badge: A shows his name, B shows a smiley.
- A 4-frame animation he designs himself (rocket launch, winking face).
- Doorbell: touching the logo plays a melody.
- Find out: what changes if the animation is in
on startinstead offorever?
Boss project · Mood Badge
A = happy, B = sad, A+B = surprised, shake = a dizzy animation with a sound.
Variables: the program's memory
Big idea: a variable is a labelled box that remembers a number or word while the program runs.
- Step counter: shake adds 1, A shows the count, B resets to 0.
- Dice: shake shows a random 1 to 6.
- Board-game scorekeeper: A and B add points for two players, A+B shows both.
- Countdown timer from 10 that plays a sound at 0.
- Puzzle: a dice that never rolls the same number twice in a row. (He needs a second variable.)
Boss project · Rock Paper Scissors
Shake picks a random 0, 1 or 2 and shows the matching icon. Add a score variable for wins.
Decisions: if / else and sensors
Big idea: programs make choices based on conditions. Sensors turn the real world into numbers that conditions can test.
- Night light: dark means screen on, otherwise off.
- Thermometer with a sad face above 28 °C.
- Spirit level: tilt left shows a left arrow, right a right arrow, flat a dot. He finds the numbers by testing.
- Compass showing N, E, S or W with a 4-way
else if. - Clap switch: a loud sound toggles the screen. Needs a true/false variable.
- Find out: why does
if light level < 50flicker? Fix it with two thresholds, one to turn on and one to turn off.
Boss project · Reaction Timer
Wait a random 1 to 5 seconds, show a target, then measure how fast he presses A with running time (ms). Bonus: catch anyone who presses before the target appears.
Loops: doing things many times
Big idea: loops repeat work, and the loop counter is a variable that changes each time around.
- Light every LED one at a time, row by row: a loop inside a loop.
- Draw a diagonal line, then an X, using only
forloops andplot. - Live bar graph of sound or light level.
- Rain: random LEDs fall from top to bottom.
- Flash while button A is not pressed. Then explain how
whilediffers fromif. - Puzzle: light only the border of the 5×5 screen with loops and one
if.
Boss project · Bouncing Dot
A dot moves around the screen and bounces off the edges, using x and y variables plus direction variables dx and dy.
States: programs with modes
Big idea: real programs have modes, like menu, playing and game over. One variable called state decides what the program is doing right now. This is the biggest jump from beginner to real coder.
No new blocks at this level. It's about organising the blocks he already knows.
- Traffic light: green, yellow, red with timing, plus a pedestrian button that changes the state.
- Multi-tool: A switches mode (thermometer, compass, dice, light meter), B uses the current tool.
- Stopwatch with start, stop and reset on only two buttons.
- Find out: what goes wrong when two
foreverloops change the screen at once? How doesstatefix it?
Boss project · Virtual Pet
Hunger and happiness variables drop over time. A = feed, B = play, shake = wake up. States: happy, hungry, sleeping, gone. The pet must be able to recover from a bad state.
Functions: build your own blocks
Big idea: a function packages a job under a name so it can be reused, and it keeps big programs readable. Parameters give it inputs and return gives back an answer.
flash(times)flashes the screen that many times.drawSquare(size)on the LED screen.isEven(n)returns true or false, used inside anif.celsiusToFahrenheit(c)so the thermometer can switch units.- Refactor the Level 5 pet into functions. It should get shorter and clearer.
Boss project · Simon Says, part 1
Functions showArrow(direction), playNote(direction) and waitForPress(), which returns the button pressed.
Lists: remembering many things
Big idea: a list holds many values in order, and each one is reached by its position, starting from 0.
- Magic 8-ball: shake picks a random answer from a list.
- Show every number in a list, then find the biggest with a loop.
- Count presses of each button in a list of counts.
- Record 10 temperature readings and show the average.
- Puzzle: reverse a list. Then sort 5 numbers with bubble sort, his first real algorithm.
Boss project · Simon Says, complete
The sequence grows by one random step each round and lives in a list. One mistake means game over with a score. This combines events, variables, if, loops, states, functions and lists.
Radio: micro:bits talking to each other
Big idea: two programs on two devices can work together by sending messages. This is the start of networking.
The simulator shows two micro:bits on screen as soon as a radio block is used, so a second board isn't needed to start. A second real micro:bit (about $20) makes this level much more fun.
- Messenger: A sends a heart, B sends a smiley.
- Remote doorbell.
- Hot and cold: signal strength shows how close the other micro:bit is.
- Two-player reaction duel where both boards agree on the winner.
- Puzzle: design a tiny protocol. Which numbers mean what? Write it down like an engineer.
Boss project · Tilt Remote for the Cutebot Pro
One micro:bit is the controller (tilt to steer), the other rides in the car and drives. Needs the extension github.com/elecfreaks/pxt-cutebot-pro.
The real world: pins, sensors, motors, robots
Big idea: code can read and control physical things. Real sensors are noisy, so robots need feedback: measure, decide, adjust, repeat.
- Servo pointer that follows the light level or tilt, using
map. - Alarm: the PIR or ultrasonic sensor triggers the buzzer.
- Graph a sensor in the Data Viewer and find the noise. Smooth it by averaging the last 5 readings, using a list.
- Cutebot drives a square, then a triangle, using functions.
- Obstacle avoider with states: driving, backing up, turning.
- Line follower: first simple if/else steering, then smooth steering where the turn depends on how far off the line he is. That's his first proportional control.
Boss project · pick one
A wall-following maze solver, or one of the existing projects in cutebot_pro/blocks/ (Mood Pet is easiest, then Turtle Drawing). He reads and modifies them before writing his own version.
Thinking like a programmer
Big idea: strong coders plan, break big problems into small pieces, test each piece, and improve working code.
- Timing without pause: use
running timeso two things happen at once, like blinking an LED while reading buttons. - Searching and sorting: linear search, bubble sort, and counting how many steps each takes.
- Probability: roll a dice 1,000 times in a loop, count results in a list. Is it fair?
- Code review: read someone else's project and explain and improve it.
- Peek at JavaScript: switch a finished project to the JavaScript tab and match lines to blocks. Just curiosity, no pressure.
Capstone · he designs it
Ideas: an arcade game with levels, lives and a high score; a weather station that logs a day of temperature and light; a two-micro:bit multiplayer game; a Cutebot that plays tag with the remote.
It must use states, functions, lists and at least one sensor, with a one-page plan written before coding and a 3-minute family demo.
Keeping it fun for a smart 10-year-old
Common traps
foreverLevel 5 (states) and Level 6 (functions)pause everywhere, so buttons feel unresponsiveLevel 10: timing with running timeforever loops fighting over the screenOne loop owns the screen; the others only change variablesget value at 0 until it's automaticon start