Tomorrow Corporation, an indie game studio, writes about how it makes games and about the internals of retro games.
HN commenters recommend its programming puzzle games Human Resource Machine and 7 Billion Humans as fun logic training for people who like Factorio.
Not sure if 7 is old enough, I made this card "game" with my daughter when she was 10: https://punkx.org/4917/ which is not really a game but more like a puzzle, you have 54 small programs for a 4 bit made up computer (Richard Buckland's computer) and you have to interpret them in your head or with pen and paper. It's quite interesting to play with her when I change few instructions on a card. (you can also print it yourself on a4 paper)
Other interesting game are of course robot turtles (http://www.robotturtles.com/), but she might be too old for it.
And you might like Mark Rober's https://www.crunchlabs.com/
There is human resource machine that my daughter played when she was 8 or so (https://tomorrowcorporation.com/humanresourcemachine) which is a brilliant game.
Also all kinds of "crypto" books, from caesar's cipher to morse code books were very interesting
I'll reply mostly on 2. - most of these were already mentioned in the previous thread - [0] Grasshopper, [1] SpaceChem (awhile ago), [2] 7 billion humans (haven't finished it yet, and haven't played for a while), [3] Human Resource Machine and [4] TIS-100. They mostly help to build habits, and persistency, not just being fun.
The "real world" always provides much more interesting "gameplay", but it is sometimes with a too steep learning curve. :)
Edit: And I've been ninja'd by another user, but just remembered that there is another in my wishlist - [5] Baba is you (haven't played it, though)
[0] https://grasshopper.app/
[1] https://zachtronics.com/spacechem/
[2] https://tomorrowcorporation.com/7billionhumans
[3] https://tomorrowcorporation.com/humanresourcemachine
[4] https://zachtronics.com/tis-100/
[5] https://www.hempuli.com/baba/
Depends on the age?
My sample size, granted only about a dozen of Commodore 64 and Apple ][ owners, says 100% got at least as far as typing programs in from magazines. More than half made programs to calculate things, about a third made their own video games.
Of the total, at least half are engineering now (software, energy, communications), and the video game segment are software engineering leadership.
It's not clear to me how to replicate this experience today, though I applaud games such as Human Resource Machine:
https://tomorrowcorporation.com/humanresourcemachine
More, all over the map though: https://shecancode.io/coding-games
I think there's something to be said for exposure to coding as a kind of digital literacy that should be required going forward, in a "WTF even is code anyway" sense.
This is pretty much `assembly language the game`: https://tomorrowcorporation.com/humanresourcemachine
It's not a useful architecture, but it teaches the thought process really well, and you end up discovering a lot of optimization naturally.
For this article, I'm measuring every step to see what the performance implications of the changes are, which, along with some educated guesses and some googling/reading other articles, was enough for me to figure out what was going on.
In part two (https://owen.cafe/posts/the-same-speed-as-c/) especially, I didn't know what was going on with the benchmarks for a long time. Eventually I got lucky and made a change, which led to a hypothesis, which lead to more tests, which led to a conclusion.
It really is an interesting game. I'd first started with this sort of genre playing Human Resource Machine, which simulates a single accumulator architecture, and very interesting set of puzzles. The puzzles really are just standard sorting, string reversal, prime factorization. The best part I find about it is the way Pointers and Memory allocation/access and stack access is done. I'd recommend this game very much as the puzzles aren't very hard and the progress is really satisfying.
Shenzhen I/O is a great game too! But I got stuck at one point and as another comment points out, I also gave up on it. Maybe it's time to log into Steam. :)
[*] https://tomorrowcorporation.com/humanresourcemachine
If you want an alternative to the good suggestions that others have already provided, you might like the recent game "Human Resource Machine"[1], by the creators of "World Of Goo". As they describe the game:
Your office is a simple computer. ... You might describe this machine
as Harvard Architecture with a single accumulator.
Don't think of it so much as a game, but a fun interactive CPU that you program in assembler. It starts with how to use basic opcodes (I/O, math) and registers ("save a copy on the floor"). Conditional jumps (w/ an implicit flag register) are gradually added, and later puzzles use indirect addressing a lot.
[1] http://tomorrowcorporation.com/humanresourcemachine