Agile System SoftwareLearn

Workshop · C# · Kids

DN010 C# for kids: the Space Zoo

Captain Mango is building a Space Zoo and needs a programmer. In six short sits a child prints animals made of letters, teaches the computer to remember animal cards, makes parades with loops, feeds animals with a dice game, invents tricks with methods and puts on the Zoo Show. Every step is five minutes, every program is one file, and the machine tries each program with a new word and a new number to prove it really works.

Open Coding Tutor at codingtutor.agilesystemsoftware.com, pick DN010 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 · ~135 min of lessons
  • EnvironmentA VS Code seat in the browser with the .NET 10 SDK, set up by a guardian or teacher, offline. Each program is one C# file run with dotnet run zoo.cs (a .NET 10 file-based app; if this SDK build lacks it the tutor demo falls back to a small console project it creates for the child)
  • PrerequisitesNone. A guardian or teacher opens the seat; the child types and plays.
  • CertificateNone — a completion card for the guardian or teacher

Who it is for

Children aged 8 to 12 with a guardian or teacher sitting nearby who sets up the seat and starts each sit. No reading beyond simple sentences, no maths beyond counting and adding. Everything is a game about Captain Mango and the animals of the Space Zoo; the child never types anything about themselves.

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 C# file, read what it printed, change a word and run it again
  • Draw pictures with Console.WriteLine and keep them tidy
  • Remember words and numbers in variables and use them in a sentence
  • Repeat a line with a for loop to make patterns and parades
  • Make the program choose with if and else and roll a die with Random
  • Teach the computer a trick with a method and call it by name

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, Space Zoo

Four five-minute steps with a guardian or teacher nearby. Captain Mango's computer talks when you tell it to: one line of C# prints one line of text. Run a file, read what it printed, change a word, run it again. Pictures made of letters: a rocket, a star and the zoo gate. Live in the seat: the tutor runs zoo.cs, changes the greeting, draws a rocket out of slashes and stars, and shows what happens when a quote mark goes missing.

Lab Make gate.cs print the Space Zoo gate: a top bar of = signs, a sign line that says SPACE ZOO, a bottom bar, and a rocket under it made of at least three lines. Session 1 checkpoint.

4 mini steps · ~22 min
  1. 1.1Make the computer talk5 minchecked · T3

    Predict

    The file says Console.WriteLine("Hello, Captain!"); What shows up when it runs?

    Lesson

    A program is a list of instructions the computer reads from top to bottom. Console.WriteLine tells it to print one line. The words go inside quotes and the line ends with a semicolon, like a full stop.

    Demo

    The tutor opens dotnet/dn010/demo/hello_demo.cs, runs dotnet run hello_demo.cs in the terminal, points at the printed line, changes the words to "Welcome to the Space Zoo", and runs again so both results sit in the terminal.

    On screen

    Explorer → dotnet/dn010/demo/hello_demo.cs → Terminal → dotnet run hello_demo.cs → change the words → run again.

    Hands-on

    Open dotnet/dn010/s1/hello.cs, which prints one line. Change the words to a greeting from Captain Mango (not about you), run it, then add a second Console.WriteLine with an animal sound and run it again.

    Explain

    Say what dotnet did with your file.

    Check

    hello.cs prints two lines — checked (T3): seat_file seat_run

    #s1-1

  2. 1.2Pictures made of letters6 minchecked · T3

    Predict

    Three Console.WriteLine lines print " /\", " / \" and "/____\". What do you see?

    Lesson

    Every WriteLine is one row of a picture. Spaces push things to the right, so you can draw a rocket, a star or an animal out of slashes, dashes and letters, one row at a time.

    Demo

    The tutor draws a rocket in dotnet/dn010/demo/rocket_demo.cs, five rows of slashes and pipes, runs it, then shows that a backslash needs a friend: "\\" prints one backslash.

    Hands-on

    In dotnet/dn010/s1/star.cs print a star or a rocket at least four rows tall using spaces, slashes and the letter o. Run it and look at the shape.

    Explain

    Why do we need spaces at the start of some rows?

    Check

    star.cs prints a picture four rows tall — checked (T3): seat_run

    #s1-2

  3. 1.3When the computer gets confused5 minchecked · T3

    Predict

    A line is missing its closing quote: Console.WriteLine("Moo); What happens?

    Lesson

    When a line is broken the computer does not guess; it prints a message with the line number and stops. That message is a helper. Go to that line, look for a missing quote, bracket or semicolon, and fix it.

    Demo

    The tutor breaks dotnet/dn010/demo/oops_demo.cs three ways in turn: a missing quote, a missing semicolon, WriteLin instead of WriteLine. Each time the error line number is read aloud and the fix is made.

    Hands-on

    Copy dotnet/dn010/samples/s1/broken.cs to dotnet/dn010/s1/fixed.cs. It has three mistakes. Fix them one at a time by reading the message, until it prints "Zoo open!" and "Moo".

    Explain

    What do you look at first when the computer is confused?

    Check

    fixed.cs runs and prints Zoo open! and Moo — checked (T3): seat_run

    #s1-3

  4. 1.4Lab: the zoo gate6 minchecked · T3

    Predict

    The gate needs a bar, a sign, a bar. How many Console.WriteLine lines is that at least?

    Lesson

    Put the session together: rows of = signs for bars, a sign with words, and a rocket drawn row by row. Read your file once from the top before you run it, looking for every quote and semicolon.

    Demo

    The tutor builds dotnet/dn010/demo/gate_demo.cs live: bar, the words SPACE ZOO, bar, a three-row rocket; runs it; then shows the check that the machine runs on the gate.

    Hands-on

    Write dotnet/dn010/s1/gate.cs: a row of = signs, a row with the words SPACE ZOO, another row of = signs, then a rocket at least three rows tall. Run it clean.

    Explain

    Which row of your gate was the hardest to get right and why?

    Check

    gate.cs prints bar, SPACE ZOO, bar and a rocket — checked (T3): seat_run

    #s1-4

Session 2 · Animal cards

Captain Mango keeps a card for every animal: a name, a number of legs, a sound. In C# a card line is a variable: a name that remembers a word or a number. Words are strings, counts are ints, and the two behave differently when you add them. A sentence built from variables with a dollar sign in front of the quotes. Live in the seat: three animal cards, a sentence that glues them, 2 + 3 next to "2" + "3", and a card whose number changes mid-program.

Lab Make card.cs with variables for an animal's name, legs and sound, then print a three-line animal card that uses all of them, and change the legs number half way and print the card again. Session 2 checkpoint.

4 mini steps · ~22 min
  1. 2.1Remembering a word5 minchecked · T3

    Predict

    string animal = "Moonbat"; Console.WriteLine(animal); What prints?

    Lesson

    A variable is a box with a label. string animal = "Moonbat"; puts the word Moonbat in a box called animal. Later you write the label and the computer uses what is inside.

    Demo

    In dotnet/dn010/demo/card_demo.cs the tutor makes string animal and string sound, prints both, then changes only the word inside the box and shows the print changes without touching the WriteLine lines.

    Hands-on

    In dotnet/dn010/s2/word.cs make a string variable called animal with a made-up space animal name and a string called sound. Print each one on its own line.

    Explain

    What is a variable, in your own words?

    Check

    word.cs uses two string variables — checked (T3): seat_file seat_run

    #s2-1

  2. 2.2Remembering a number5 minchecked · T3

    Predict

    int legs = 6; Console.WriteLine(legs + 2); What prints?

    Lesson

    Numbers live in int boxes, with no quotes. Plus on numbers adds them; plus on words glues them. "2" + "3" is the word 23, but 2 + 3 is 5. The computer never mixes the two up, so you must not either.

    Demo

    The tutor prints 2 + 3 and then "2" + "3" side by side, then makes int legs = 8 for a space spider and prints legs * 2 to count all the shoes it needs.

    Hands-on

    In dotnet/dn010/s2/legs.cs make int legs for your animal and int eyes. Print legs + eyes, legs * 2, and the glued words "2" + "3" so you can see the difference.

    Explain

    Why is "2" + "3" not 5?

    Check

    legs.cs prints sums and the glued 23 — checked (T3): seat_file seat_run

    #s2-2

  3. 2.3A sentence with holes in it6 minchecked · T3

    Predict

    string a = "Moonbat"; int n = 2; Console.WriteLine($"{a} has {n} wings"); What prints?

    Lesson

    Put a $ before the opening quote and the sentence gets holes: {animal} is filled with whatever the animal box holds. One line can mix words and numbers neatly, which is how the animal card is printed.

    Demo

    The tutor rewrites the card demo with $"{animal} says {sound} and has {legs} legs", runs it, then changes legs to 100 and runs again to show the sentence updating on its own.

    Hands-on

    In dotnet/dn010/s2/sentence.cs make animal, sound and legs variables and print one $ sentence that uses all three. Then change legs and print the sentence a second time.

    Explain

    What does the $ do in front of the quotes?

    Check

    sentence.cs prints two $ sentences — checked (T3): seat_file seat_run

    #s2-3

  4. 2.4Lab: the animal card6 minchecked · T3

    Predict

    If legs = 4 and later legs = 6, and you print the card twice, what do the two cards show?

    Lesson

    The card lab uses everything: a string for the name and sound, an int for legs, and $ sentences for three card lines. Changing one variable and printing again shows that the sentences follow the boxes.

    Demo

    The tutor makes a card for Zorbit the space lizard: a NAME line, a LEGS line, a SOUND line, with = bars around it, then sets legs to 7 and prints the card again. The machine's check is shown afterwards.

    Hands-on

    Write dotnet/dn010/s2/card.cs: variables animal, legs and sound; print a card of three $ lines (Name: …, Legs: …, Sound: …); change legs to a different number; print the three lines again.

    Explain

    Why did the second card show a different legs number?

    Check

    card.cs prints two cards with different legs — checked (T3): seat_file seat_run

    #s2-4

Session 3 · Parades and patterns

Printing the same row ten times is boring to type and easy to get wrong. A for loop says "do this a number of times" and counts while it goes. Patterns: a row of stars that grows, a parade of animals each with a number, a countdown for the rocket. Live in the seat: a loop that prints Zorbit five times, the counter printed inside the loop, a pattern that grows one star per row, and the classic mistake of counting from 1 to 10 and getting nine.

Lab Make parade.cs that prints a numbered parade of an animal (1 to N where N is a variable), then a triangle of stars N rows tall, then a 3-2-1 countdown ending in LIFT OFF. Session 3 checkpoint.

4 mini steps · ~23 min
  1. 3.1Say it again, five times5 minchecked · T3

    Predict

    for (int i = 0; i < 3; i++) Console.WriteLine("Hop"); How many Hops print?

    Lesson

    A for loop repeats a block. for (int i = 0; i < 5; i++) means: start i at 0, keep going while i is below 5, add one each time. The lines inside the curly braces run once per turn.

    Demo

    In dotnet/dn010/demo/loop_demo.cs the tutor prints "Zorbit hops!" five times with a loop, then changes 5 to 12 to show the one number that controls the whole parade.

    Hands-on

    In dotnet/dn010/s3/again.cs make a for loop that prints your animal's sound exactly 7 times. Then change it to 4 and run again.

    Explain

    Which number decides how many times the loop runs?

    Check

    again.cs prints the sound four times with a for loop — checked (T3): seat_file seat_run

    #s3-1

  2. 3.2The counter inside the loop6 minchecked · T3

    Predict

    for (int i = 1; i <= 3; i++) Console.WriteLine($"{i}. Zorbit"); What is the first line?

    Lesson

    The counter i is a variable you can print. Starting at 1 and using <= gives human numbering: 1, 2, 3. A parade is just a loop that prints the count and an animal on each turn.

    Demo

    The tutor prints a numbered parade of five Zorbits, then changes the start to 0 and shows the parade starting at 0, then fixes it and talks about counting the way people do.

    Hands-on

    In dotnet/dn010/s3/parade_count.cs print a numbered parade of your animal from 1 to 6, each line like "3. Zorbit marches".

    Explain

    How do you make the parade start at 1 instead of 0?

    Check

    parade_count.cs numbers 1 to 6 — checked (T3): seat_run

    #s3-2

  3. 3.3A pattern that grows6 minchecked · T3

    Predict

    new string('*', 3) makes what?

    Lesson

    new string('*', i) makes a row of i stars. Put that inside a loop where i grows and you get a triangle, one star taller each row. The same trick draws a rocket flame or a mountain for the zoo.

    Demo

    The tutor prints a triangle of stars five rows tall, then flips it by counting down from 5 to 1, then adds spaces with new string(' ', 5 - i) in front so the triangle points up.

    Hands-on

    In dotnet/dn010/s3/triangle.cs print a triangle of stars 5 rows tall, row 1 one star, row 5 five stars, using a loop and new string.

    Explain

    Why does the triangle get one star taller each row?

    Check

    triangle.cs prints a 5-row star triangle — checked (T3): seat_run

    #s3-3

  4. 3.4Lab: the parade and the countdown6 minproven · T4

    Predict

    A countdown loop goes for (int i = 3; i >= 1; i--). What prints last before LIFT OFF?

    Lesson

    One variable N at the top controls the whole program: the parade is N long, the triangle is N tall, and the countdown runs from 3 to 1. The machine will try your program with a different N, so no number may be typed twice.

    Demo

    The tutor builds the parade program with int n = 4, runs it, then changes only n to 6 and runs again to show the parade and triangle both grow. The check with a new number is shown.

    Hands-on

    Write dotnet/dn010/s3/parade.cs with int n read from the first command-line word (int.Parse(args[0])): a numbered parade of your animal 1 to n, a star triangle n rows tall, then 3, 2, 1 and LIFT OFF.

    Explain

    Why should n be typed only once in the file?

    Check

    parade.cs parades, climbs and counts down for any n — proven (T4): seat_file seat_run

    #s3-4

Session 4 · Feeding time

The zoo animals are hungry and the computer must decide: if the animal is big, give it a bucket; otherwise a cup. if and else let a program choose. A die made with Random picks how many snacks fall out of the machine. Live in the seat: a size check that prints a different line for a big and a small animal, a loop that rolls a die five times, and a feeding game that says FULL when the animal has had enough.

Lab Make feed.cs: roll a six-sided die five times, add the rolls into a food total, say "Yum" for a roll of 1 to 3 and "YUM YUM" for 4 to 6, and at the end print FULL if the total is 15 or more, otherwise STILL HUNGRY. Session 4 checkpoint.

4 mini steps · ~22 min
  1. 4.1If this, then that5 minproven · T4

    Predict

    int legs = 8; if (legs > 4) Console.WriteLine("Many legs"); else Console.WriteLine("Few legs"); What prints?

    Lesson

    if asks a yes-or-no question about a value. When the answer is yes the lines in its braces run; otherwise the else lines run. Only one of the two ever runs.

    Demo

    In dotnet/dn010/demo/feed_demo.cs the tutor sets int size = 9, prints "Bucket of snacks" if size > 5 and "Cup of snacks" otherwise, then changes size to 2 to show the other line.

    Hands-on

    In dotnet/dn010/s4/bigsmall.cs make int size from args[0] and print "Bucket of snacks" when size is more than 5 and "Cup of snacks" otherwise.

    Explain

    When does the else part run?

    Check

    bigsmall.cs picks bucket or cup — proven (T4): seat_run

    #s4-1

  2. 4.2Rolling a die5 minchecked · T3

    Predict

    Random.Shared.Next(1, 7) gives which numbers?

    Lesson

    Random.Shared.Next(1, 7) rolls a six-sided die: the top number is never reached. Printing the roll in a loop gives a different answer each run, which is what makes a game a game.

    Demo

    The tutor rolls a die five times in a loop and prints each roll, runs twice to show different numbers, then rolls two dice and adds them.

    Hands-on

    In dotnet/dn010/s4/dice.cs roll a die 5 times in a loop and print each roll like "Roll: 4". Run it twice and compare.

    Explain

    Why is 7 never rolled?

    Check

    dice.cs prints five rolls between 1 and 6 — checked (T3): seat_file seat_run

    #s4-2

  3. 4.3Adding things up6 minchecked · T3

    Predict

    int total = 0; then in a loop total = total + roll; three rolls of 2, 5, 1. What is total at the end?

    Lesson

    A total is a box that starts at 0 and grows: total = total + roll adds the roll into it each turn. After the loop the box holds the sum of everything that happened. += is the short way to write it.

    Demo

    The tutor adds int total = 0 above the dice loop, total += roll inside it, prints "Total food: {total}" after, and runs twice to show the total matches the rolls.

    Hands-on

    Copy dice.cs to dotnet/dn010/s4/total.cs. Keep a total of the five rolls and print "Total food: N" as the last line.

    Explain

    Why does total start at 0?

    Check

    total.cs ends with a food total between 5 and 30 — checked (T3): seat_run

    #s4-3

  4. 4.4Lab: the feeding game6 minproven · T4

    Predict

    Rolls of 4, 4, 4, 1, 1 total 14. The rule is FULL at 15 or more. What prints at the end?

    Lesson

    The game joins a loop, a die, a total and two ifs: one inside the loop to say Yum or YUM YUM, one after it to say FULL or STILL HUNGRY. To let the machine check it, the program also accepts a fixed seed so rolls repeat.

    Demo

    The tutor builds feed_game_demo.cs with var die = new Random(int.Parse(args[0])) so the same seed gives the same rolls, runs it with seed 7 twice to show identical output, then with seed 8.

    Hands-on

    Write dotnet/dn010/s4/feed.cs: a Random made from the seed in args[0]; five rolls of Next(1, 7); print "Yum" for 1-3 and "YUM YUM" for 4-6; keep a total; print "Total food: N"; then FULL if N >= 15 else STILL HUNGRY.

    Explain

    Why does the program take a seed number?

    Check

    feed.cs plays the game the same way for any seed — proven (T4): seat_file seat_run

    #s4-4

Session 5 · Animal tricks

Captain Mango teaches each animal a trick once and then just says its name. In C# a trick is a method: a named block of lines you can call as often as you like. Tricks can take a word or a number to work with, and can hand a number back. Live in the seat: a Bow method called three times, a Jump method that takes how high, a Legs method that returns a number, and the tidy program that is nothing but method calls at the top.

Lab Make tricks.cs with three methods: Bow(name) prints a bow line, Jump(name, times) prints a jump line that many times, and Shoes(legs) returns legs times 1; the top of the file calls all three for an animal named in args[0]. Session 5 checkpoint.

4 mini steps · ~23 min
  1. 5.1Teach a trick once5 minchecked · T3

    Predict

    void Bow() { Console.WriteLine("Zorbit bows"); } Bow(); Bow(); How many lines print?

    Lesson

    A method is a trick with a name. void Bow() { ... } teaches it; Bow(); performs it. Teaching happens once, performing can happen any number of times, from anywhere in the file.

    Demo

    In dotnet/dn010/demo/tricks_demo.cs the tutor writes Bow and Spin methods below the top-level lines, calls Bow twice and Spin once, and shows that the order of calls decides the order of lines.

    Hands-on

    In dotnet/dn010/s5/bow.cs write a method Bow() that prints two lines of a bow (a line of text and a little picture), then call it three times.

    Explain

    What is the difference between teaching a trick and doing it?

    Check

    bow.cs defines Bow and calls it three times — checked (T3): seat_file seat_run

    #s5-1

  2. 5.2A trick with a word in it6 minchecked · T3

    Predict

    void Greet(string who) { Console.WriteLine($"Hi {who}"); } Greet("Zorbit"); What prints?

    Lesson

    A method can take something in its brackets: void Greet(string who). Each call hands over a different word and the method uses it under the name who. One trick, many animals.

    Demo

    The tutor rewrites Bow as Bow(string name) and calls it for Zorbit, Moonbat and Biscuit, then adds Jump(string name, int times) with a loop inside to jump that many times.

    Hands-on

    In dotnet/dn010/s5/greet.cs write Greet(string who) that prints a greeting using who, and call it for three different made-up animal names.

    Explain

    Why is a method with a word in the brackets more useful?

    Check

    greet.cs greets three names with one method — checked (T3): seat_file seat_run

    #s5-2

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

    Predict

    int Double(int n) { return n * 2; } Console.WriteLine(Double(4)); What prints?

    Lesson

    Some tricks answer a question. int Shoes(int legs) { return legs; } hands a number back with return; the call Shoes(8) becomes 8 wherever you write it. Methods that only compute and return are the easiest to check.

    Demo

    The tutor writes int Shoes(int legs) returning legs, and int Treats(int legs) returning legs * 2, prints both for a spider with 8 legs, then changes 8 to 100 to show the answers follow.

    Hands-on

    In dotnet/dn010/s5/shoes.cs write int Treats(int legs) that returns legs * 2, and print "Treats: N" for legs read from args[0].

    Explain

    What does return do?

    Check

    shoes.cs doubles any legs count — proven (T4): seat_file seat_run

    #s5-3

  4. 5.4Lab: three tricks6 minproven · T4

    Predict

    Jump("Zorbit", 2) prints "Zorbit jumps!" how many times?

    Lesson

    The lab program is tidy: three method calls at the top, three methods below. Bow(name) prints, Jump(name, times) loops, Shoes(legs) returns. The machine tries it with a different animal name and legs count.

    Demo

    The tutor builds tricks_lab_demo.cs: args[0] is the name, args[1] the legs; Bow, Jump three times, then "Shoes needed: N" from Shoes. Runs for Zorbit 8 and Biscuit 4.

    Hands-on

    Write dotnet/dn010/s5/tricks.cs: name from args[0], legs from args[1]; Bow(name) prints "<name> bows"; Jump(name, 3) prints "<name> jumps!" three times; print "Shoes needed: " plus Shoes(legs) where Shoes returns legs.

    Explain

    Why is the top of the file so short?

    Check

    tricks.cs bows, jumps and counts shoes for any animal — proven (T4): seat_file seat_run

    #s5-4

Session 6 · The Zoo Show

Opening night. The Zoo Show puts every piece together: a gate banner, a parade of animal cards from a list, a feeding round with the die, a trick from each animal, and a goodbye banner. New this session: a list of animal names so the show can hold as many animals as you like, and foreach to walk through them. Live in the seat: a list of three names, foreach printing a card for each, and the show assembled one method at a time.

Lab Make show.cs, the Zoo Show: a gate banner, one card per animal in a list taken from the command line, a seeded feeding round, a bow from each animal, and a THE END banner. The machine runs it with different animals and seeds. Session 6 checkpoint and the end of the course.

4 mini steps · ~23 min
  1. 6.1A list of animals5 minchecked · T3

    Predict

    var zoo = new List<string> { "Zorbit", "Biscuit" }; Console.WriteLine(zoo.Count); What prints?

    Lesson

    A list is a row of boxes under one name. new List<string> { ... } fills it; zoo.Add("Moonbat") adds one more; zoo.Count says how many; zoo[0] is the first. Lists let the show grow without new variables.

    Demo

    In dotnet/dn010/demo/show_demo.cs the tutor makes a list of three animal names, prints Count, prints zoo[0] and zoo[2], adds a fourth with Add and prints Count again.

    Hands-on

    In dotnet/dn010/s6/zoo.cs make a list of three made-up animal names, add a fourth with Add, print "Animals: N" with the Count, then print the first and the last name.

    Explain

    Why is a list better than four separate variables?

    Check

    zoo.cs holds four animals in a list — checked (T3): seat_file seat_run

    #s6-1

  2. 6.2Visit every animal6 minchecked · T3

    Predict

    foreach (var a in zoo) Console.WriteLine(a); with three animals in zoo prints how many lines?

    Lesson

    foreach (var a in zoo) visits each animal in turn and calls it a inside the block. No counter to get wrong, no Count to check: the loop ends when the animals run out.

    Demo

    The tutor replaces three card prints with one foreach that prints a card line per animal, then shows the same loop calling the Bow method from session 5 for each animal.

    Hands-on

    In dotnet/dn010/s6/visit.cs make a list of three animals and use foreach to print "<name> is in the zoo" for each, then a second foreach that prints "<name> waves".

    Explain

    What does foreach save you compared with a for loop?

    Check

    visit.cs walks the list twice with foreach — checked (T3): seat_file seat_run

    #s6-2

  3. 6.3Animals from the command line6 minproven · T4

    Predict

    dotnet run names.cs Zorbit Biscuit — what is args.Length?

    Lesson

    The words typed after the file name arrive in args, which already behaves like a list. foreach over args lets the guardian choose the animals at the terminal without changing the code: that is how the machine will test the show.

    Demo

    The tutor runs the demo with three names, then five, and shows foreach over args printing a card line per name and "Animals: {args.Length}" at the end.

    Hands-on

    In dotnet/dn010/s6/names.cs print "Welcome <name>" for every word in args, then print "Animals: N" with args.Length.

    Explain

    Where do the names come from when the machine tests your program?

    Check

    names.cs welcomes any animals typed at the terminal — proven (T4): seat_run

    #s6-3

  4. 6.4Lab: opening night6 minproven · T4

    Predict

    The show takes a seed first, then animal names. dotnet run show.cs 7 Zorbit Biscuit — which args item is the seed?

    Lesson

    The Zoo Show is a program made of the session labs: Gate() prints the banner, Card(name) prints a card, Feed(die) rolls and totals, Bow(name) bows, TheEnd() closes. The top is a dozen lines; the methods below do the work.

    Demo

    The tutor assembles show_lab_demo.cs from the earlier demos method by method, runs it with seed 7 and three animals, then with seed 3 and two animals, and shows the check reading the lines.

    Hands-on

    Write dotnet/dn010/s6/show.cs: seed from args[0], animals from the rest. Print a = bar, "SPACE ZOO SHOW", a = bar; for each animal "Card: <name>"; five seeded rolls as "Roll: N" and "Total food: N"; for each animal "<name> bows"; then "THE END".

    Explain

    Which part of the show was reused from an earlier session, and how?

    Check

    show.cs runs the whole show for any seed and animals — proven (T4): seat_file seat_run

    #s6-4

Outcome

By the end of the course the tutor's checks will have verified: one small C# program per step, each run by the machine with a new word and a new number; six zoo pieces that grow into the Zoo Show, a program that prints a parade of animal cards, rolls a die to feed them and ends with a banner, exactly as the published show does for inputs 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 the .NET 10 SDK, set up by a guardian or teacher, offline. Each program is one C# file run with dotnet run zoo.cs (a .NET 10 file-based app; if this SDK build lacks it the tutor demo falls back to a small console project it creates for the child). Your work lives in dotnet/dn010; 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 DN010 from the course button in the chat and press Tutor me. Every lesson, demo and hands-on step is also published below.