Video games have always been associated with hackers and programmers. Many developers first gain an interest in computers through playing computer games. But some games are more directly tied with programming because they teach specific languages or skills that programmers commonly use.
These 10 games span different programming topics, and they either actively teach specific skills or give developers opportunities to practice them in fun ways. Some games are geared for novice developers while others are more fun for experienced developers. There are games that teach important front-end development skills, games that walk players though using Git and confusing code editors, games that let players sharpen their SQL skills and ones that teach players about logic gates and machine learning and hacking.
Finally, there’s a good comeback for when you’re asked whether you’re doing something useful with your time — you’re learning programming.
10 Games for Learning Programming
- Oh My Git!
- Vim Adventures
- CSS Diner
- SQL Murder Mystery
- Shenzhen I/O
- Human Resource Machine
- Robo Instructus
- While True: learn()
- Grey Hack
Games for Learning Programming
Oh My Git!
Git is an essential tool for software developers. It does the hard work of keeping track of code versioning for developers and also makes it easy for people to share code and collaborate. The downside is that it can get rather complicated to use and it’s hard for beginners to visualize how exactly the commands they input are affecting the files Git is managing.
Luckily, there are many great resources for learning and leveling up your Git skills, such as GitHub’s quick introductory course on GitHub and the Learn Git Branching tutorial. But those who want a more gamified introduction to Git can play Oh My Git!, a game that teaches developers how to use Git commands and manipulate files.
Players can download the game on their Linux, Mac or Windows machines and progress through the levels to learn more and more complex Git techniques. The game provides visualizations of Git commands so developers can clearly understand the effects of their instructions on files. Players can test out all the commands they learn on real Git repositories within the game and practice interacting remotely with team members. Oh My Git! is also good practice for developers looking for more opportunities to refresh and test their understanding of Git commands.
Vim — originally called Vi — is a code editor introduced in the 1980s for Unix machines which quickly became popular. Vim is still a useful code editor because it’s quite powerful and also available on many different types of computers, including all Mac machines. Developers often run into situations where they need to quickly edit a file and using the built-in Vim editor is the easiest way, like when they are working inside containers or accessing remote servers. If a software developer knows how to edit files using Vim, they can write code anywhere.
But that is a big if. For beginners, writing code using Vim can be a nightmare. Unlike most modern code editors, Vim doesn’t have a graphical user interface. Instead, Vim users must rely on their knowledge of the editor’s commands and keyboard shortcuts in order to navigate and interact with the text they are editing, and all interactions occur through a command-line interface. It’s often a steep learning curve, with frustrated students getting stuck in the editor while trying to reference long lists of commands.
Vim Adventures offers an ingenious way to teach essential Vim commands to students. Actions that players take to navigate through the game and solve puzzles mirror the commands and keyboard shortcuts developers must learn in order to interact with Vim. The gameplay quickly makes those commands feel like second nature, and the game design makes for a fun and enjoyable experience.
Cost: Free demo level; $25 for six months access to the full version.
Writing code to style front-end applications is no cake walk. Cascading style sheets are files that accompany HTML code and add color and other characteristics to specific HTML elements. Because HTML code can get nested and complex, and because there are not a lot of frameworks for formatting CSS, styling can be quite tricky. Lines of code often cancel each other out, and it can become hard to decipher which lines are active and which are overwritten.
CSS Diner attempts to teach developers the intricate rules of CSS selection through a game that imagines HTML elements as plates of food. An animated section at the top of the game displays increasingly intricate arrangements of food laid out on a table, and it’s accompanied by a simplified HTML section that represents the food arrangements in HTML format and an editable CSS section. Players are prompted to select certain food items from the table by writing the correct CSS code to select the particular food item.
In this MMO, players are able to interact with each other within the game, such as by trading resources or attacking each other’s colonies. While players are away from the game, their colonies are still active and their scripts are still running in real time. As a result, responses to interactions with other players — like actions to protect your colonies from attackers — must also be scripted in advance.
Cost: $14.99 on Steam.
SQL Murder Mystery
This game combines SQL sleuthing with real sleuthing by having players execute SQL queries to get more information about the circumstances of a murder and find the murderer. It helps to be familiar with basic SQL commands, but players don’t have to be a database expert to enjoy this game. SQL Murder Mystery does a good job of teaching different ways of extracting data and metadata using queries.
The game interface is just an input box where players can write SQL queries following the SQLite syntax, hit the Run button and see the query results displayed just below. Sometimes the results of a SQL query will be too long and players have to narrow down their search parameters by executing more precise queries.
Shenzhen I/O is another game developed by Zachtronics, where the player takes on the role of a disaffected engineer who moves to Shenzhen, China, to build computer chips at the fictional Shenzhen Longteng Electronics company. The player is handed increasingly challenging circuits to design, beginning with an assignment to make lights flash in a distinct pattern.
The game is great at helping developers visualize the interface between hardware and software and how computation occurs on a lower level. In addition to the challenge of piecing together a viable circuit for each assignment, players are rated based on the cost of the chips they build — determined by how efficiently the employee is able to build the chips and the cost of each component used.
Players are given a 47-page employee reference manual as the only source of help, and are expected to read the online manual for instructions on how to use the chip components and write code that directs the flow of inputs and outputs through the chips. Side puzzles throughout the game make for fun additional challenges, and a throughline in the game’s plot hints at mysterious problems within the company that the player can explore.
Cost: $14.99 on Steam.
Human Resource Machine
In this game, players work at a giant, drab corporation that wants to use automation to speed up work and drive down costs. But at this company, instead of automating the work, it’s the employees who get automated.
Players “program” employee minions at the company, who are doing very dry assembly-line work — moving boxes from one conveyor belt to another, essentially. Players must program employees in such a way that they pick up the right items, arrange the items in the correct order and send the items off to their proper destinations. That doesn’t involve writing code, exactly. Instead, players program employees to work the assembly lines by using draggable commands that, fittingly, mimics assembly language.
The game’s grimly whimsical art and design keeps things fun, and there are narrative portions that give entertaining glimpses of the incredibly unpleasant world the company resides in — set, by the look of it, in an unfortunately near future.
Cost: $14.99 on Steam.
In this game, players write code to control a little robot that needs to move through a series of obstacles to reach the end of each level. The game starts easy, giving players a few commands to orient the robot within the game and move it around. Each level unlocks new functions that players can use, making the code they write and the actions the robot can take more sophisticated.
Other concepts are slowly introduced, like loops and conditional statements, and even the idea of scope within programs. Players can also check how efficiently their code was able to solve the solution on each level. Robo Instructus does a good job of teaching programming concepts, and players who are novices will get a good sense of what programming feels like.
Cost: $12.99 on Steam.
While True: learn()
Artificial intelligence and machine learning often seem impenetrable to people who don’t do it for a living, including software developers. But as machine learning technologies improve and become more widely used, it’s useful to get a better idea of how they work. That’s the aim of while True: learn(), a game that helps players understand machine learning.
Don’t expect to leave the game knowing how to train real models, but players will learn a lot about the steps involved in building working machine learning models. The game takes players through many different types of machine learning techniques, introducing new techniques for players to use in the order that they were invented in the real world.
In the game’s storyline, the player is an engineer who lives with his cat and trains machine learning models for work. The engineer soon realizes that his cat is a machine learning genius — if only he could understand what his cat is trying to tell him! With that, the game kicks off by having the player build a cat-to-human translation model.
Cost: $12.99 on Steam.
Grey Hack is another MMO game that is designed to feel like a hacking simulation, giving players free rein to do what they want within the boundaries of the game. The interface is simple: just a desktop with a terminal, file explorer, browser and a few other applications. Players are given missions and largely left to figure out how to complete them on their own by exploring the world of the game, reading the in-game manual and mixing technical exploits with social engineering to get their objective. It’s possible to interact with other players within the game by attempting to exploit them or defending yourself from their exploits.
Because the game doesn’t do much hand-holding, it feels geared for advanced players who want to spend time figuring out exploits on their own and enjoy the feel of a hacking simulation. Players will learn a lot about scripting and different types of exploits, so it can also be educational for those wanting to understand what it takes to secure a system.
The game is still actively being developed but early access is available.
Cost: $19.99 on Steam.