A game that lets players to experience the process of software development is a great method to teach programming and coding concepts such as 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 drab company and have to build computer chips manually. They are given increasingly complex circuits to design. They begin with making lights blink in a certain pattern.
The interface of the game is very similar to tools for developers found in browsers and also teaches scripting. Another excellent example is Screeps which blends JavaScript programming with massively multiplayer online games to create self-sustaining colonies. Both games excel at teaching basic concepts, and slowly introducing other players.
www.mrworkspace.nl/2015/08/03/techedge-2011-presentations-and-videos/