5 Games That Teach You How to Code

These Web games will give you a fun and engaging introduction to the world of programming.


CodeCombat is an HTML5 role-playing game (RPG) that teaches you fundamental programming concepts.


In CodeCombat, you play a hero adventuring through the game’s levels. The first level is Kithard Dungeon, which covers basic programming concepts. You’re faced with coding challenges throughout your journey, and if you overcome them, you’ll unlock the next level and earn experience points (XP) that you can use to improve your hero.

Levels in CodeCombat

CodeCombat is appealing to young, aspiring programmers. According to an in-game survey, 62% of CodeCombat’s users are under 18 years old.

CodeCombat supports five programming languages: JavaScript, CoffeeScript, Lua, and Python. The game covers a wide range of programming topics — strings, variables, method invocation, vector drawing, and much more.

Code Hunt

Code Hunt is a Sci-Fi-themed HTML5 game developed by Microsoft Research.

Code Hunt

In this game, you play as a code hunter tasked with repairing code so that it returns the expected result. There are 14 levels, called Sectors in the Code Hunt nomenclature, for you to complete.

Code Hunt user interface

Code Hunt supports either Java or C#. Programming concepts you’ll learn include arithmetic, loops, and conditional expressions.

Teachers who would like to extend the game with additional Sectors can do so by first reading the Code Hunt Designer Manual.


CodinGame is a huge suite of challenging games for programmers. If you want to improve your coding skills, playing CodinGame is a fun way to do so.


Over 20 programming languages including PHP, C, and JavaScript are supported by CodinGame. The user interface is feature-packed and can be customized. For example, you can choose your code editor’s style: "Emacs", "Vim", or "Classic" (the default theme).

CodinGame example

The game can be played on single player mode or multiplayer mode. In multiplayer mode, you can solve CodinGame challenges with other users.


Screeps is a massively multiplayer online game (MMO) for JavaScript programmers.


The game is an open-world strategy game where you control units, called creeps, that will help you mine resources, establish your territory, and so forth. Being a multiplayer online game means your creeps will be alongside the creeps of other players.

Screeps simulation

Controlling your creeps involves writing JavaScript. (Screeps = scripting your creeps.) To learn how to play the game, hit up the docs.


In FightCode, the objective is simple: Create a robot that will defeat the robots of other players.


How do you create a robot? By writing some JavaScript. For example, you can use the .rotateCannon() method to rotate your robot’s cannon by a certain number of degrees when a certain event happens.

FightCode demo

Before building your indestructible, world-dominating robot, the first step you’ll need to take is to read the docs to learn how to code a robot.

Read Next

10 Puzzle Websites to Sharpen Your Programming Skills

15 Free Books for People Who Code

5 Good Habits That Will Make You a Better Coder

Jacob Gube is the founder of Six Revisions. He’s a front-end developer. Connect with him on Twitter and Facebook.

This was published on Sep 30, 2015


Cathy Mayhue Oct 01 2015

Hi Jacob,

I was thinking about ways to teach my 11 years old basic concepts of computer programming and you seem to have made my task very easy. I am specially inclined towards code hunt, as it was created by the masters of computer programming Microsoft.


    Jacob Gube Oct 01 2015

    I firmly believe that video games have the potential to be powerful educational tools. Code Hunt is great. But it’s a bit more difficult to grok compared to CodeCombat. Try all of these games out to see which ones you think would be more appealing to your kid!

Charles Oct 10 2015

I actually tried all 5, and was surprised on many different levels.

CodeCombat: I love the RPG aspect, but getting from point A to point B was a bit frustrating due to not knowing how far self.move actually moves, and ultimately caused me to give up.
CodeHunt: The approach here is very different – at first I thought it was great that they are teaching you how to spot patterns. Unfortunately, this is all they ever teach; less about actually coding, more about trying to guess what algorithm they are using.
CodinGame: Probably my favorite. I was very impressed by the sheer visual appeal, the wide array of programming languages to choose from, and a _very smart_ IDE. However, I would not say this is for beginner programmers – maybe intermediate.
Screeps: I love the MMO aspect. Unfortunately, there is no code teaching whatsoever. You pay money via a subscription for the opportunity to test your AI against the AI of hardened programmers. Good luck. Great niche, though.
FightCode: A step down from Screeps, but still not much actual “teaching” going on.

None of these outlets actually “teach you how to code”, despite the misleading headline. In my opinion, there are others that do a better job at teaching: codeschool, w3schools, codecademy,, or heck, even :)

    Brian Mar 06 2016

    CodeCombat is great for learning, that move function is just for the first hour or two of playing until they give you access to a better one. If you ever have to introduce kids to coding I’d use codecombat for sure. Make sure they don’t have access to a credit card though.

This comment section is closed. Please contact us if you have important new information about this post.