There seem to be some programming games out there
I will store some links in here so that I can come back to those when I have a bit more time available.
Robot Odyssey is a very old game written back in 1984 by The Learning Company for the Apple ][ computer. It's an educational game that teaches the basics of programming through wiring together logic gates. Within the game you solve puzzles by programming robots so they can move around, grab objects, and communicate with each other.
DroidQuest, Java port of Robot Odyssey. Download and play the complete version or join in on the play testing. See the latest screenshots, and discuss the game with other players.
And even more cab be found from wikipedia programming game article. There are some links to lists of programming games.