A game that lets players experience the process of software development can be an excellent method of teaching coding concepts and programming techniques, including loops and conditional statements. Zachtronics Shenzhen I/O is one game that accomplishes this. It puts players in the shoes disgruntled engineers who work for a non-existent company and must build computer chips by hand. The circuits they’re asked to create become more complicated beginning with making the lights flash in a specific pattern.
The game’s interface is very similar to tools for developers found in browsers and teaches scripting. Another great example is Screeps which is a game that combines JavaScript coding with massively multiplayer online gaming to build self-sustaining colonies. Both games do a wonderful job of teaching basic concepts while slowly introduce new ones.