A game that lets players to experience software development is an excellent way to introduce programming and coding concepts like loops and conditional statements. Zachtronics Shenzhen I/O is a game that accomplishes this. It puts players in the shoes unhappy engineers who work for a non-existent company and have to build computer chips by hand. They are given increasingly challenging circuits to design. They begin with making lights flash in a particular pattern.
The interface of the game is similar to the one found in browsers, and it is a great way to teach scripting. Screeps is a different excellent example, which is a game www.mrworkspace.nl/2021/12/17/how-managed-workspace-sessions-can-benefit-your-business/ that combines JavaScript code with massively multiplayer online gaming to build self sustaining colonies. Both games do a great job of teaching the basics while slowly introduce new ones.