Agile System SoftwareLearn

Workshop · Rust · Kids

RS010 Rust for kids: the Rocket

Build a rocket with Pixel the robot and launch it, in real Rust. Twenty-four tiny steps across six short sits: draw the rocket in text, give it dials, count it down, check the weather, teach it tricks, and put on a Launch Show. Every step ends with the machine trying the child's program with a new word or number, which is how it knows it really works.

Open Coding Tutor at codingtutor.agilesystemsoftware.com, pick RS010 from the course button in the chat and press Tutor me. Every lesson, demo and hands-on step is also published below.

  • LevelKids
  • Duration6 short sits of about 25 minutes (~3 h)
  • Size6 sessions · 24 mini steps · ~136 min of lessons
  • EnvironmentA VS Code seat in the browser with Rust and cargo ready and offline; a grown-up sets it up and sits nearby; the child edits one file, src/main.rs, and presses Run
  • PrerequisitesNone. A grown-up creates the seat and stays nearby. The child can read short words and use a keyboard.
  • CertificateNone — a completion card for the guardian or teacher

Who it is for

Children of about 8 to 12 with a guardian or teacher beside them. No reading of long text: every step is five or six minutes, the tutor speaks, and the answers are buttons. The child only ever types inside one file. Pixel the robot is the character who builds the rocket with them; no personal details are ever asked for.

A kids course: a guardian or teacher sets up the seat and stays nearby. The tutor never asks for personal details, answers come through buttons or by voice, and nothing is shared or ranked. How kids courses work.

What you will be able to do

  • Run a Rust program with cargo run, read what it printed and change one line
  • Read the red message to the line it names and fix a missing quote or semicolon
  • Give a value a name with let and print it inside a sentence
  • Repeat things with a for loop, counting up and counting down
  • Choose with if and else, and among many cases with match
  • Put a trick in a function with a name and an input, and call it

Syllabus

Every session ends in a lab the machine checks on your own code. Open a session's mini steps to read each lesson, demo and hands-on task; the badge shows how far the engine can verify it: checked · T3 a check runs over your files, proven · T4 the grader also tries inputs you did not see, tutored · T0 done on your word. Each step has its own link (for example #s1-1).

Session 1 · Hello, rocket

Four tiny steps with Pixel the robot. The tutor makes the first rocket project with cargo new and the child only ever opens one file, src/main.rs. Press Run, read what the rocket says, change the words. Draw a rocket out of letters and symbols, one println! per line. Make a mistake on purpose and learn that the red message points at a line. Live in the seat: a rocket that says hello, a rocket drawn in five lines, a missing quote and its message.

Lab Make a rocket poster: a line of = signs, a title line, a line of = signs, then Pixel's rocket in at least four lines of text art, then one line that says what the rocket is called. Sit 1 checkpoint.

4 mini steps · ~23 min
  1. 1.1Press Run5 minchecked · T3

    Predict

    The file says println!("Hello, rocket!"); What will show when we press Run?

    Lesson

    A Rust program is a file of instructions. The computer reads it from the top and does each line. Our rocket lives in src/main.rs, and cargo run is the big red button that makes it go.

    Demo

    The tutor opens rust/rs010/demo/s1/src/main.rs, points at println!, presses cargo run in the terminal, and the rocket says hello. Then the tutor changes the words inside the quotes and runs again.

    On screen

    Explorer → rust/rs010/s1/src/main.rs → Terminal → cargo run.

    Hands-on

    Open rust/rs010/s1/src/main.rs. Change the words inside the quotes to something Pixel the robot would say, like "Beep! Rocket ready." Press cargo run and read it back.

    Explain

    What did cargo run do with the file?

    Check

    The rocket says something new — checked (T3): seat_run

    #s1-1

  2. 1.2Draw the rocket6 minchecked · T3

    Predict

    We write three println! lines one under the other. How many lines come out?

    Lesson

    One println! makes one line. Put five of them one under the other and you can draw a picture out of symbols: a nose, a body, fins and fire. Spaces count too, so the rocket stands up straight.

    Demo

    The tutor draws a rocket in rust/rs010/demo/s1/src/main.rs with five println! lines: a ^ for the nose, | | for the body, / \ for the fins and * * for the fire, runs it, and nudges one space to show the rocket lean.

    Hands-on

    In rust/rs010/s1/src/main.rs draw Pixel's rocket in at least four println! lines. Use ^ | / \ * and spaces. Run it and straighten it until it stands up.

    Explain

    Why did we need more than one println!?

    Check

    A rocket of at least four lines — checked (T3): seat_run

    #s1-2

  3. 1.3The red message is a map6 minchecked · T3

    Predict

    We forget the ; at the end of a println! line. What happens when we press Run?

    Lesson

    When Rust cannot read a line it does not guess. It shows a red message with a little arrow under the problem and the line number. Read the number, go to that line, look at the arrow. That is the whole trick.

    Demo

    The tutor removes a ; in the demo file, runs, and reads the red message slowly: error, the line number, the arrow. Puts the ; back. Then removes a closing quote and shows the message is different but still points at a line.

    Hands-on

    Copy rust/rs010/samples/s1/oops.rs over your src/main.rs. It has two mistakes: a missing ; and a missing quote. Press Run, read the line number, fix one, run again, fix the other, until the rocket prints "Fixed!".

    Explain

    What do we look at first in the red message?

    Check

    oops.rs fixed: it prints Fixed! — checked (T3): seat_build seat_run

    #s1-3

  4. 1.4Lab: the rocket poster6 minchecked · T3

    Predict

    A poster has a line of = signs, a title, another line of = signs, then the rocket. Which line is the title?

    Lesson

    Everything from this sit in one program: a frame of = signs, a title, Pixel's rocket, and a last line that names the rocket. Read your file once from top to bottom before you press Run, like a pilot checks the dials.

    Demo

    The tutor builds a poster in the demo project: = line, title "PIXEL ROCKET", = line, the five-line rocket, then "This rocket is called Comet." Runs it, and shows the little check the machine will do on the child's poster.

    Hands-on

    In rust/rs010/s1/src/main.rs make your poster: a line of = signs, a title, a line of = signs, your rocket in at least four lines, and a last line "This rocket is called ..." with a made-up name you invent for the rocket.

    Explain

    Say one thing you check before pressing Run.

    Check

    Poster: frame, title, rocket, name line — checked (T3): seat_run

    #s1-4

Session 2 · Rocket dials

Four steps about remembering things. A rocket has dials: fuel, speed, a name on the side. In Rust a dial is a name made with let. Numbers and words are different kinds of dial. Print a dial inside a sentence with {}. The magic line: a word and a number can arrive from the launch pad, so the machine can try the program with new ones. Live in the seat: a fuel dial, a dial that goes down with let mut, and a dashboard that greets a robot by a name it was given.

Lab Build the dashboard: it takes a robot name and a fuel number from the launch pad and prints a three-line dashboard with the name, the fuel and how much fuel is left after a burn of 25. Sit 2 checkpoint.

4 mini steps · ~22 min
  1. 2.1A dial called fuel5 minchecked · T3

    Predict

    We write let fuel = 100; then println!("Fuel: {}", fuel); What prints?

    Lesson

    let makes a dial: a name that remembers a value. fuel remembers 100 until we change it. In a println! sentence, {} is a hole, and the dial you list after the sentence fills the hole.

    Demo

    The tutor writes let fuel = 100; and let speed = 7; in rust/rs010/demo/s2/src/main.rs, prints both with {}, runs it, then changes 100 to 42 in one place and shows every sentence update.

    Hands-on

    In rust/rs010/s2/src/main.rs make two dials with let: fuel and speed, with numbers you choose. Print two sentences, "Fuel: ..." and "Speed: ...", using {} for the numbers.

    Explain

    What does the {} do inside the quotes?

    Check

    Fuel and speed dials print — checked (T3): seat_file seat_run

    #s2-1

  2. 2.2Word dials and number dials5 minchecked · T3

    Predict

    let name = "Comet"; let fuel = 100; Can we do fuel + 1? Can we do name + 1?

    Lesson

    Some dials hold numbers and some hold words. Words go in quotes. Rust remembers which is which and stops you doing number things to words. That is Rust being careful for you, not being mean.

    Demo

    The tutor adds let name = "Comet"; prints "Rocket {} has {} fuel", then tries name + 1, reads the red message that says a word is not a number, and deletes the bad line.

    Hands-on

    Add a word dial let name = "..." with a made-up rocket name. Print one sentence that uses the name and the fuel together, like "Rocket Comet has 100 fuel".

    Explain

    Why did Rust refuse name + 1?

    Check

    A sentence with a name and a number — checked (T3): seat_file seat_run

    #s2-2

  3. 2.3The magic line from the launch pad6 minproven · T4

    Predict

    The magic line reads a word typed after cargo run --. If we type cargo run -- Zoom, what is the word?

    Lesson

    The launch pad can hand the rocket a word and a number when it starts. The magic line reads them. You copy the magic line exactly; you do not need to understand every bit yet. It lets the machine test your rocket with new words.

    Demo

    The tutor pastes the two magic lines into the demo: let name = std::env::args().nth(1).unwrap_or("Pixel".to_string()); and let fuel: i32 = std::env::args().nth(2).and_then(|a| a.parse().ok()).unwrap_or(100); then runs cargo run -- Zoom 80.

    Hands-on

    Copy the two magic lines from rust/rs010/samples/s2/magic.txt to the top of your main. Delete your old let name and let fuel. Run cargo run -- Comet 90 and then cargo run -- Star 30 and watch the sentence change.

    Explain

    Where do the word and the number come from now?

    Check

    The rocket uses the word and number it is given — proven (T4): seat_run

    #s2-3

  4. 2.4Lab: the dashboard6 minproven · T4

    Predict

    let mut fuel = 100; fuel = fuel - 25; What is fuel now?

    Lesson

    A dial that changes needs let mut. A burn uses fuel: fuel = fuel - 25 moves the dial down. The dashboard shows the name, the fuel before, and the fuel after the burn, using the word and number from the launch pad.

    Demo

    The tutor builds the demo dashboard: three lines, "Rocket: {}", "Fuel: {}", "After burn: {}", with let mut fuel and a burn of 25, and runs it with two different launch-pad numbers.

    Hands-on

    In rust/rs010/s2/src/main.rs, with the magic lines on top, make fuel mut, burn 25, and print three lines: Rocket: <name>, Fuel: <number before>, After burn: <number after>. Try cargo run -- Comet 100.

    Explain

    Why did fuel need mut?

    Check

    Dashboard: name, fuel, fuel after a burn of 25 — proven (T4): seat_file seat_run

    #s2-4

Session 3 · Again and again

Four steps about repeating. A countdown says 5, 4, 3, 2, 1 without writing five lines: a for loop does the saying. Count down with .rev(). Make a star field by printing a row of stars many times. Make the rocket climb by printing it a little further up each time. Live in the seat: a countdown that uses the launch-pad number, a star field that grows, a rocket that climbs five rows.

Lab The countdown show: take a number from the launch pad, count down from it to 1, print LIFT OFF!, then print a star field with as many rows as the number. Sit 3 checkpoint.

4 mini steps · ~22 min
  1. 3.1Count up with for5 minchecked · T3

    Predict

    for i in 1..=3 { println!("{}", i); } prints what?

    Lesson

    A for loop says: for every number in this range, do the thing inside the braces. 1..=5 is the numbers 1 to 5. The name i changes each time round. One loop can do the work of many lines.

    Demo

    The tutor writes for i in 1..=5 { println!("Step {}", i); } in rust/rs010/demo/s3/src/main.rs, runs it, then changes 5 to 10 and shows the loop simply does more without any more code.

    Hands-on

    In rust/rs010/s3/src/main.rs write a for loop that prints "Check 1" to "Check 6", one per line. Then change the 6 to 8 and run again.

    Explain

    What changes each time round the loop?

    Check

    Check 1 to Check 8 from a loop — checked (T3): seat_file seat_run

    #s3-1

  2. 3.2Count down with .rev()5 minchecked · T3

    Predict

    for i in (1..=3).rev() prints the numbers in which order?

    Lesson

    A countdown is a loop that goes backwards. Put the range in brackets and add .rev() and it runs from the top number down to 1. After the loop ends, one more println! shouts LIFT OFF!

    Demo

    The tutor changes the demo loop to (1..=5).rev(), runs it to show 5 4 3 2 1, then adds println!("LIFT OFF!"); after the closing brace and explains why it prints only once.

    Hands-on

    Make your loop count down from 5 to 1, one number per line, then print LIFT OFF! once after the loop.

    Explain

    Why does LIFT OFF! print only once?

    Check

    5 to 1, then LIFT OFF! — checked (T3): seat_run

    #s3-2

  3. 3.3Star field and the climbing rocket6 minchecked · T3

    Predict

    "*".repeat(4) makes which text?

    Lesson

    A word can be stretched: "*".repeat(n) makes n stars in a row, and " ".repeat(n) makes n spaces. Print a row of stars inside a loop and you get a star field. Print spaces before the rocket, more each time, and it climbs.

    Demo

    The tutor prints "*".repeat(i) for i in 1..=5 to make a growing star field, then prints " ".repeat(i) + the rocket nose ^ for i in 0..5 so the ^ walks across the screen.

    Hands-on

    After LIFT OFF!, add a loop that prints a row of stars that grows from 1 star to 5 stars. Then a second loop that prints the rocket nose ^ moved across by 0, 1, 2, 3, 4 spaces.

    Explain

    How did the star row get longer each time?

    Check

    A growing star field and a moving ^ — checked (T3): seat_file seat_run

    #s3-3

  4. 3.4Lab: the countdown show6 minproven · T4

    Predict

    The launch pad gives the number 3. The countdown prints how many number lines before LIFT OFF!?

    Lesson

    Put the launch-pad number into the loops. Count down from that number to 1, shout LIFT OFF!, then print a star field with that many rows. Now the same program makes a short show or a long one, depending on the number it is given.

    Demo

    The tutor uses the magic number line from sit 2 as count, writes (1..=count).rev() for the countdown and 1..=count for the star rows, runs cargo run -- Pixel 3 and cargo run -- Pixel 6.

    Hands-on

    In rust/rs010/s3/src/main.rs: read the number from the launch pad with the magic line (second word), count down from it to 1, print LIFT OFF!, then print a star field with that many rows, each row one star longer than the last.

    Explain

    Why can one program make a short show and a long show?

    Check

    Countdown and star field sized by the launch pad — proven (T4): seat_run

    #s3-4

Session 4 · Go or no-go

Four steps about choosing. A rocket does not launch in a storm: if the weather is good we go, else we wait. Three weathers need three answers, and match picks one cleanly. A dice roll decides a lucky launch, and the number comes from the launch pad so the same roll can be tried again. Live in the seat: an if/else weather check, a match on three weather words, a dice game that prints a different sentence for each face.

Lab Go or no-go: the launch pad gives a weather word and a dice number. Sunny with a roll of 4 or more is GO; rain is always NO-GO; anything else is HOLD. Print the decision and a reason. Sit 4 checkpoint.

4 mini steps · ~23 min
  1. 4.1If the sky is clear5 minproven · T4

    Predict

    let fuel = 30; if fuel > 50 { println!("GO"); } else { println!("WAIT"); } What prints?

    Lesson

    if asks a yes-or-no question. If the answer is yes, the first braces run; else, the second braces run. Only one of the two ever happens. Questions use > < == and the answer is always true or false.

    Demo

    The tutor writes if fuel >= 50 { println!("GO"); } else { println!("Not enough fuel"); } in rust/rs010/demo/s4/src/main.rs and runs it with the launch-pad fuel at 80 and then 20.

    Hands-on

    In rust/rs010/s4/src/main.rs, with the magic lines on top, print "GO" if the launch-pad number is 50 or more, else print "Not enough fuel". Try it with 80 and with 20.

    Explain

    Can GO and Not enough fuel both print in one run?

    Check

    GO at 50 or more, else Not enough fuel — proven (T4): seat_run

    #s4-1

  2. 4.2Three weathers with match6 minproven · T4

    Predict

    match weather { "sunny" => "GO", "rain" => "NO-GO", _ => "HOLD" } and weather is "fog". Which word?

    Lesson

    When there are many answers, match lines them up: one arm per word, and a last arm with _ for anything else. It reads like a table and Rust makes sure you never forget the anything-else case.

    Demo

    The tutor makes the first magic word the weather, writes a match with arms for "sunny", "cloudy", "rain" and _, prints the chosen word, and runs cargo run -- sunny, cargo run -- rain, cargo run -- fog.

    Hands-on

    Use the first launch-pad word as the weather. Write a match with arms for sunny (GO), cloudy (HOLD), rain (NO-GO) and _ (UNKNOWN WEATHER). Print the result. Try all four.

    Explain

    What is the _ arm for?

    Check

    match on four weathers — proven (T4): seat_file seat_run

    #s4-2

  3. 4.3The dice launch6 minproven · T4

    Predict

    A die shows 1 to 6. We launch when the roll is 4 or more. How many faces are a launch?

    Lesson

    A dice roll is a surprise number. The real rocket would roll it with rand, but a surprise is hard to check, so our dice number comes from the launch pad and the tutor rolls a real die for it. Then if roll >= 4 we launch.

    Demo

    The tutor rolls a real die on camera, types cargo run -- sunny 5, and the demo prints "Rolled 5: lucky launch!"; rolls again, gets 2, and the program prints "Rolled 2: try again".

    Hands-on

    Use the launch-pad number as the roll. Print "Rolled <n>: lucky launch!" when it is 4 or more, otherwise "Rolled <n>: try again". The grown-up rolls a die and you type the number.

    Explain

    Why does the dice number come from the launch pad and not from inside the program?

    Check

    Lucky launch at 4 or more — proven (T4): seat_run

    #s4-3

  4. 4.4Lab: go or no-go6 minproven · T4

    Predict

    Weather is sunny and the roll is 3. GO needs sunny and 4 or more. What is the decision?

    Lesson

    Two questions can join with &&, which means both must be true. GO needs sunny && roll >= 4. Rain is always NO-GO. Everything else is HOLD. Print the decision on one line and a reason on the next, so Pixel knows why.

    Demo

    The tutor writes the three-way decision in the demo with if weather == "rain", else if weather == "sunny" && roll >= 4, else, and runs it with sunny 6, sunny 2, rain 6 and fog 6.

    Hands-on

    In rust/rs010/s4/src/main.rs: weather from the first launch-pad word, roll from the number. Print "Decision: GO" for sunny with a roll of 4 or more, "Decision: NO-GO" for rain, "Decision: HOLD" otherwise, then a second line "Reason: ..." in your own words.

    Explain

    What does && mean in the GO question?

    Check

    GO / NO-GO / HOLD from weather and roll — proven (T4): seat_run

    #s4-4

Session 5 · Rocket systems

Four steps about teaching the computer a trick once and using it many times. A function is a named trick: fn draw_rocket() draws the rocket wherever you call it. A function can take an input, like how many stars. A function can hand back an answer, like how much fuel is left. Live in the seat: the rocket drawn three times from one function, a stars function with a number, a fuel_left function that returns a number, and a systems check that calls them all.

Lab The systems check: four functions — draw_rocket, stars(n), fuel_left(start, burn) and status(fuel) — called from main to print a rocket, a star row sized by the launch pad, the fuel after a burn of 30, and OK or LOW. Sit 5 checkpoint.

4 mini steps · ~23 min
  1. 5.1A trick with a name5 minchecked · T3

    Predict

    fn beep() { println!("Beep"); } and main calls beep(); three times. How many Beeps?

    Lesson

    fn makes a function: a trick with a name. Write the rocket drawing inside fn draw_rocket() { ... } once, outside main. Then draw_rocket(); inside main draws it, and you can call it as many times as you like.

    Demo

    The tutor moves the five rocket println! lines into fn draw_rocket() in rust/rs010/demo/s5/src/main.rs, calls it three times from main with a blank line between, and runs it: three rockets.

    Hands-on

    In rust/rs010/s5/src/main.rs write fn draw_rocket() with your rocket inside, and call it twice from main with a println!() between so there are two rockets with a gap.

    Explain

    Why write the rocket inside a function?

    Check

    fn draw_rocket called twice — checked (T3): seat_file seat_run

    #s5-1

  2. 5.2A trick with an input6 minproven · T4

    Predict

    fn stars(n: u32) prints "*".repeat(n). We call stars(3). What prints?

    Lesson

    A function can take an input in its brackets: fn stars(n: u32). The n is a dial that only exists inside the function. Call stars(3) and n is 3; call stars(7) and n is 7. u32 just means a counting number.

    Demo

    The tutor writes fn stars(n: u32) { println!("{}", "*".repeat(n as usize)); } and calls stars(1), stars(3), stars(5) to make a little star staircase, then calls it with the launch-pad number.

    Hands-on

    Write fn stars(n: u32) that prints a row of n stars. Call it with 2, then 4, then with the launch-pad number from the magic line, so cargo run -- Pixel 6 ends with six stars.

    Explain

    Where does n get its value?

    Check

    stars(n) prints n stars — proven (T4): seat_file seat_run

    #s5-2

  3. 5.3A trick that gives something back6 minproven · T4

    Predict

    fn fuel_left(start: i32, burn: i32) -> i32 { start - burn } What is fuel_left(100, 30)?

    Lesson

    Some tricks hand back an answer. The arrow -> i32 says a whole number comes back, and the last line without a ; is the answer. let left = fuel_left(100, 30); puts 70 into left. The same inputs always give the same answer.

    Demo

    The tutor writes fn fuel_left(start: i32, burn: i32) -> i32 { start - burn }, calls it twice with different numbers, prints both answers, and shows that adding a ; to the last line makes Rust complain.

    Hands-on

    Write fn fuel_left(start: i32, burn: i32) -> i32. In main, call it with the launch-pad fuel and a burn of 30, and print "Fuel left: <answer>". Try cargo run -- Pixel 100.

    Explain

    What does the arrow -> i32 tell us?

    Check

    fuel_left returns start minus burn — proven (T4): seat_file seat_run

    #s5-3

  4. 5.4Lab: the systems check6 minproven · T4

    Predict

    fn status(fuel: i32) -> &'static str gives "LOW" under 40, else "OK". status(39) is?

    Lesson

    Four tricks working together: draw_rocket draws, stars(n) decorates, fuel_left works out the fuel, and status(fuel) says OK or LOW. main just calls them in order. A program made of small named tricks is easy to read and easy to check.

    Demo

    The tutor adds fn status(fuel: i32) -> &'static str with an if, then writes a main of six lines that calls the four functions, and runs cargo run -- Pixel 100 and cargo run -- Pixel 50.

    Hands-on

    In rust/rs010/s5/src/main.rs: keep draw_rocket, stars and fuel_left; add status(fuel) that returns "LOW" under 40 and "OK" otherwise. main prints the rocket, a star row sized by the launch-pad number, "Fuel left: <n>" after a burn of 30, and "Status: OK" or "Status: LOW".

    Explain

    Why is main so short now?

    Check

    Four functions, one systems check — proven (T4): seat_file seat_run

    #s5-4

Session 6 · The Launch Show

Four steps that put the whole rocket together. Plan the show on paper first: what happens in what order. Build it in two halves, checking each half runs. Then the Launch Show itself: the dashboard, the go/no-go decision, the countdown, LIFT OFF!, the climbing rocket and the star field, all from functions, all driven by the word and number from the launch pad. The machine runs the show with words and numbers the child never saw. Live in the seat: the plan, the first half, the second half, the show.

Lab The Launch Show: cargo run -- <weather> <count>. Print the dashboard, the decision (GO for sunny with a count of 3 or more, NO-GO for rain, HOLD otherwise), and only on GO the countdown from count, LIFT OFF!, the rocket and a star field of count rows. Sit 6 checkpoint and the course's final check.

4 mini steps · ~23 min
  1. 6.1Plan the show5 minchecked · T3

    Predict

    Which comes first in a launch show: the countdown or the go/no-go decision?

    Lesson

    Before building, plan. The show has five parts in order: dashboard, decision, countdown, lift off, star field. Each part will be a function with a name. Writing the names down first is how real programmers start.

    Demo

    The tutor writes the plan as five comment lines in rust/rs010/demo/s6/src/main.rs — // 1 dashboard, // 2 decision ... — and then writes five empty functions with those names so the file builds with nothing inside.

    Hands-on

    In rust/rs010/s6/src/main.rs write the five-part plan as comments, then five empty functions named dashboard, decision, countdown, lift_off and star_field. Press Run: it should build and print nothing yet.

    Explain

    Why plan before typing?

    Check

    Five named functions, the file builds — checked (T3): seat_file seat_build

    #s6-1

  2. 6.2Build the first half6 minproven · T4

    Predict

    decision("rain", 5) should give which word?

    Lesson

    Fill the first two functions. dashboard(weather, count) prints the two dials. decision(weather, count) hands back GO, NO-GO or HOLD with the rules from sit 4. main reads the magic lines and calls both. Check the half before going on.

    Demo

    The tutor fills dashboard and decision in the demo, with decision returning &'static str from an if/else chain, and runs cargo run -- sunny 4 and cargo run -- rain 4.

    Hands-on

    Fill in dashboard (prints "Weather: <word>" and "Count: <number>") and decision (GO for sunny with count 3 or more, NO-GO for rain, HOLD otherwise). main prints "Decision: <word>". Run with sunny 4 and rain 4.

    Explain

    Why check half the show before building the rest?

    Check

    Dashboard and decision work — proven (T4): seat_run

    #s6-2

  3. 6.3Build the second half6 minproven · T4

    Predict

    countdown(3) then lift_off() then star_field(3). How many lines in all, with one rocket line in lift_off?

    Lesson

    Fill the last three functions from sit 3: countdown(count) counts down to 1, lift_off() prints LIFT OFF! and the rocket, star_field(count) prints the growing rows. Call them from main for now without the decision, just to see them run.

    Demo

    The tutor fills countdown, lift_off and star_field in the demo, calls all three from main after the decision line, and runs cargo run -- sunny 3 to show the whole thing scroll by.

    Hands-on

    Fill countdown (count down from count to 1), lift_off (print LIFT OFF! and your rocket) and star_field (rows of stars from 1 to count). Call them from main after the decision. Run with sunny 3.

    Explain

    Which function from sit 3 did countdown copy?

    Check

    Countdown, lift off and star field run — proven (T4): seat_run

    #s6-3

  4. 6.4The Launch Show6 minproven · T4

    Predict

    The show gets rain 5. Which parts print?

    Lesson

    The last piece: the decision controls the show. if decision(...) == "GO" { countdown; lift_off; star_field } so a rainy day prints only the dashboard and the decision. The machine will run your show with weathers and counts you never typed.

    Demo

    The tutor wraps the last three calls in if d == "GO" { ... }, runs cargo run -- sunny 4, cargo run -- rain 4 and cargo run -- cloudy 7, then presses the check and reads its lines together with the child.

    Hands-on

    Finish rust/rs010/s6/src/main.rs: main reads the launch pad, prints the dashboard, prints "Decision: <word>", and only when it is GO runs countdown, lift_off and star_field. Try sunny 4, rain 4 and cloudy 7, then press Check.

    Explain

    Tell Pixel what your show does when it rains.

    Check

    The Launch Show runs for any weather and count — proven (T4): seat_file seat_run

    #s6-4

Outcome

By the end of the course the tutor's checks will have verified: a rocket poster, a dashboard that takes a robot name and a fuel number from the launch pad, a countdown with a star field, a go/no-go weather check, four rocket systems written as functions, and the Launch Show, which the machine runs with words and numbers the child did not see.

Completion

No certificate for kids courses. When the last show is done, the guardian or teacher receives a completion card listing the sessions and the checks the machine ran. No streaks, no leaderboards, nothing shared.

Environment

A VS Code seat in the browser with Rust and cargo ready and offline; a grown-up sets it up and sits nearby; the child edits one file, src/main.rs, and presses Run. Your work lives in rust/rs010; the tutor's demo files live apart from yours and the tutor never edits your hands-on file while you are working on it.

Open Coding Tutor at codingtutor.agilesystemsoftware.com, pick RS010 from the course button in the chat and press Tutor me. Every lesson, demo and hands-on step is also published below.