This is really fun, it gets me thinking about making this essentially into a course, where they have to learn how to do all these things to solve the mystery at the end, which is the final exam. Maybe the homework are little subplots they have to solve.
Going to try this later.
Really cool idea, will try to have a play later.
The concept reminds me a little of some books available in the 1980s that combined a story with little BASIC type-in programs[1].
More modern alternatives along a similar line are also available[2] but kiddo here is more interested in learning Lua for Roblox :)
[1] https://en.wikipedia.org/wiki/Micro_Adventure
[2] https://cfiesler.medium.com/novels-to-get-kids-and-teens-exc...