A game that lets players experience software development can be an excellent method of teaching coding concepts and programming techniques, including loops and conditional statement. Games that allow this include Zachtronics Shenzhen I/O which puts players in the shoes of disaffected engineers who work for an ordinary chip manufacturer and have to design computer chips by hand. They are given increasingly challenging circuits to create, starting with the making lights flash in a particular pattern.
The interface of the game is similar to the one is found in browsers, and it also teaches scripting. Another great example is Screeps, which combines JavaScript programming and massively multiplayer online gameplay to build self-sustaining colonies. Both games are excellent at teaching the basics of concepts and gradually introducing other players.
https://mrworkspace.nl/2013/11/01/the-foolproof-news-from-software-development-world-strategy/