Teaching Kids Programming with Pi
A short demo of an interactive guide built alongside a Pi-made game: the guide runs the game's real code, code comments link back to the guide, and an in-browser tutor agent can explain pages, find code, quiz the reader, and control the running game. The speaker suggests the same pattern could help adults understand agent-written code. It is one family project with no evidence about learning outcomes or how accurate the generated explanations are.
After building a game with his children using Pi, the speaker shows the companion learning tool they made alongside it: an interactive book that explains the game's systems by running the game's real code. The book includes an in-browser tutor agent that can explain, navigate, quiz, and control the running game. He argues that the same pattern can help adults understand code that agents wrote.
This summary is based on the English auto-generated captions. The video is published on Armin Ronacher's channel, but the speaker does not name himself in the captions. The talk is a live demo with narration. It reports no measure of what the children learned, and the speaker presents the broader use for adults as an idea he is still exploring.
Key points
- Agent-built code alone teaches little. The speaker says the game was built almost entirely with Pi, with some help from Blender MCP. Watching an agent produce code mostly means watching code "fly by." He found it hard to explain the world-generation algorithms to an 8-year-old and an 11-year-old, so he decided to make the game's workings easier to follow. 00:01–01:50(opens in a new tab)
- The book runs the game's own code. The guide starts with basics: a program is a list of instructions, and a game repeatedly listens, thinks, and draws. It then points to the relevant files. Its examples execute the game's code instead of copying it. One page shows the first world layer generated from seed 123 and how the world fills up. Another shows a monster's profile, including health, damage, and the range at which it notices the player, then runs the same chasing logic the game uses. 01:50–04:26(opens in a new tab)
- An embedded tutor answers from the page and the code. The tutor runs in the browser with the reader's own API key. The current slide is supplied to the agent automatically, so it does not have to discover what the reader is viewing. In the demo, it explains why a flat diagram represents a 3D game and finds the code that maps positions to the floor. It also locates the growth factor that makes enemies stronger at deeper levels, navigates to the relevant slide, and highlights a requested line. It sometimes misses: once it did not first go to the slide the speaker expected. 04:26–07:49(opens in a new tab), 11:32–12:26(opens in a new tab), 14:14–15:15(opens in a new tab)
- The tutor can also run and change the live game. Asked to show the chasing behavior in the game, the agent launches the game, observes it, and spawns a level-one spider in the starting area, where spiders do not normally appear. When asked for many spiders, it injects extra JavaScript to spawn them. It then answers whether a spider could appear in the starting square during normal play; he expects it to say no because enemies do not spawn there. 07:49–09:29(opens in a new tab)
learn:references keep code and guide connected. The game code containslearn:references that name the guide file and slide explaining that code. The intent is that the agent updates the documentation while it edits the code. The speaker notes that the agent adds the related README references inconsistently. 08:41–10:30(opens in a new tab)- The guide explains design choices that the code does not make obvious. The speaker thinks this goes beyond teaching children. People are unlikely to read concise code from state-of-the-art models, but the guide explains it at a different level. Examples include a page on game "juice," where readers can turn off camera and hit-pause effects to feel the difference. Another covers tricks that make the game "feel good," such as coyote time, and the tutor can then show and mark where that trick is implemented. 09:29–12:26(opens in a new tab)
- Quizzes check understanding. After a topic, the tutor asks prediction questions. One asks why an item's rarity must be rolled before its affixes (item modifiers); the answer is that common items have none. He found seeded random numbers hard to explain to children even though they know Minecraft seeds. The guide explains sub-seeds for different parts of the map with a bag-of-marbles analogy, and the tutor can explain the specific generator function on the current page. 12:26–15:15(opens in a new tab)
Limits
The demo shows one family project and one speaker's impressions. It does not show the prompts or process used to generate the book, how accurate the agent-written explanations are, or whether the children learned more than they would have otherwise. The speaker notes that the approach costs extra tokens because the code has to be written in a way that supports the guide. 14:14–15:15(opens in a new tab)
Full video: https://www.youtube.com/watch?v=_35OxmSp5EM(opens in a new tab)