All these games are designed to teach you coding, logic and the logic around coding. Usually there are conceptual logic problems that you will find in these games that you will also find while coding. These games will help you understand these concepts better.
Also these games are designed to mimic some aspect of coding. IE trail and error, troubleshooting problems and layering on complexity of challenges.
Lightbot:
Robozzle
Codebreaker
http://pbskids.org/oddsquad/games/codebreaker/
10 second test:
http://www.kongregate.com/games/e_cha/10-second-test
Tranmission:
http://www.kongregate.com/games/sciencemuseum/transmission
Creeper World Series:
http://www.kongregate.com/games/whiteboardwar/creeper-world-training-sim
http://www.kongregate.com/games/whiteboardwar/creeper-world-evermore
http://www.kongregate.com/games/whiteboardwar/creeper-world-user-space
http://www.kongregate.com/games/whiteboardwar/creeper-world-2-academy
http://www.kongregate.com/games/whiteboardwar/creeper-world-3-abraxis
Portal:
Cube Composer:
Logic Box:
Manufactoria:
Logic Games:
Easy to make games:
Madeon Adventure Machine
http://www.madeon.fr/adventuremachine/?t=4,7,16,19
Otomata
http://www.earslap.com/page/otomata.html
Online Sequencer
https://onlinesequencer.net/
Game Froot
make.gamefroot.com
Sploder
3d:
Sploder physics:
http://www.sploder.com/free-physics-puzzle-game-maker.php