A game that lets players to play with software development is a great method to teach programming and coding concepts such as loops and conditional statements. Zachtronics Shenzhen I/O is one game that does this. It puts players in the shoes of disgruntled engineers who work for a dull company and are required to design computer chips by hand. The circuits they have to design get more difficult, starting with making the lights flash in a certain pattern.
The interface of the game is similar to the one found in browsers, and it helps students learn scripting. Another great example is Screeps which combines see post JavaScript programming and massively multiplayer online games to build self-sustaining colonies. Both games excel in teaching fundamental concepts and slowly introducing others.