The best “Learn to code game” I’ve ever seen.

CodeCombat: Multiplayer Programming

Learn programming with a multiplayer live coding strategy game. You’re a wizard, and your spells are JavaScript. Free, open source HTML5 game!