A game that allows players to experience the process of software development is a great way to teach coding and programming concepts like loops and conditional statements. Games that allow this include Zachtronics Shenzhen I/O which puts players in the shoes of dissatisfied engineers working for an ordinary chip manufacturer and have to build computer chips by hand. They are given increasingly challenging circuits to create, starting with making lights flash in a certain pattern.
The game’s interface appears very similar to developer tools found in browsers and teaches scripting. Another great example is Screeps which blends JavaScript programming with massively multiplayer online games to create self-sustaining colonies. Both games do a great job of teaching basic concepts while gradually introduce new ones.