I’m going to ramble my thoughts out loud in case I say something useful.
(If not, we’ll just have another incoherant word wall to add to the collection.)
I highlighted the important bits if you don’t have time for my ramblings.
You don’t need number keys.
Provide them with an extra library/utility that prints a number and that number goes up when they press up and down when they press down (and possibly cap it to something sensible, like 0-10).
int getNumber(void) const;
Remember, half the point of an API is to create an easy-to-use interface so that the end user doesn’t have to care about how it’s implemented.
You can use that to your advantage.
E.g., if you want to show off the traffic light hat:
If you make the API simple enough, a 10 year old genuinely can understand it.
That’s how Arduino came about after all.
That may or may not be a bad sign, I think it depends on:
- How many lessons there are in total
- What they’ve covered in previous lessons
- How the teachers are teaching them
- Cultural elements (e.g. here in Britain we start school at age 4, whereas other countries start aged 5)
It could just be that they aren’t as far in as you think.
And in all fariness, it’s hard enough getting teenagers and adults interested in programming, so I would expect it to be difficult to get children interested.
Personally I dislike Scratch and other forms of block code.
I think things like flowol/flow charts are good for understanding and visualising algorithms, but they always feel like a bit of a lie because they’re so far removed from the real deal.
The problem here is finding something that interests them.
Not many younglings are going to be particularly interested in maths or physics, even if they have useful aplication in games.
Instinctually I would say: try to set them a challenge.
Programming isn’t about punching numbers into a terminal, it’s about problem solving and critical thinking.
We may be architects of the abstract, but there’s always an end goal - always a problem to overcome.
Rather than trying to get them to make a program from scratch (if you’ll pardon the pun) I think it would be better to provide them with a half-finished program and get them to finish it.
A lot of people, when they start out with programming, really struggle to think for themselves.
They can verbalise an answer to the problem, but they don’t understand the language enough to know how to formalise that thought stream as code.
By giving them half-finished code, you give them a leg-up.
Not only does it test their ability to read code and understand it, but hopefully it will make it feel like you’re cooperating with them rather than demanding something from them.
When they complete the challenge, or even if they don’t complete it, you should encourage them to play around with the code in an attempt to do something interesting.
I can’t remember who said it, but I remember back when Space Engineers used to put quotes on the loading screeen, one of the quotes was something like:
“If you want to understand something, study it when it’s coming apart.”
The same is true of programming, to understand the wheel you must break it apart and reinvent it.
The main reason I understand quite a lot about the inner workings of the stdlib is because I’ve attempted to reimplement a lot of it at various points in time, and I’ve looked at different implementations - disecting them to understand how they work.
Also, humans learn from failure - trial and error is a perfectly valid learning strategy.
(Without it, we wouldn’t know which berries are poisonous.)
If you were looking for a more concrete sugggestion…
Noughts and crosses is always one of my favourite games for testing a system’s capabilities, but even if you implemented most of it and got the kids to do the finishing touches I’m slightly worried that it might involve concepts they aren’t ready for.
A number guessing game as others have suggsted could be good if you want to touch on conditional expressions.
Fundamentally I think what you demonstrate to them or ask them to do will be governed by a fundamental question:
How much (and what exactly) do you plan to teach them?