Coding is all about using the tools available to you to solve problems (then solving the problems that resulted from your solution to the previous problems, of course). That also happens to be the basic idea behind most video games, so the two combine naturally. These coding games cover plenty of languages, age ranges, and skill levels, so whether you’re a complete beginner or looking for something on the next level, there’s a game to help you learn coding the best way: by doing it.
For further learning, check out our list of free programming websites.
1. Code Combat
- High production value in terms of graphics and audio
- Guided content is great for learning basic programming concepts
- Some features and languages are only available with a subscription
2. Ruby Warrior
Ruby probably isn’t the most relevant language to learn anymore, but this coding game may be worth a shot anyway! Ruby Warrior is a 2D text-based game that lets you control your character using Ruby and general programming logic. It’s geared for intermediate and expert programmers and tosses you right in, having you read and write files in your text editor. Like classic text adventures, the game itself invokes a sense of adventure and draws upon your imagination. Whether or not you need to learn Ruby, the game is fairly interesting and may leave you wanting to keep improving your solutions!
- Available offline as a downloadable command line game
- Game’s open source code allows you to learn from or modify it
- Last updated in 2012
Good to know: prefer watching videos? Learn to code from these 10 YouTube channels.
- Multiplayer games are available
- Many programming languages supported
- All content is free
- Puzzles require heavy thinking
CodeGym is more a course than a game, but there’s a pretty serious story element included. The goal is to get you from a beginner to a junior Java developer using story-driven challenges and projects in the IntelliJ IDE (Integrated Development Environment), which is a great introduction to the coding tools you’ll be using later. There’s pleasant cartoony artwork throughout the story component, making this course feel fun and whimsical. While you have to pay for some parts of CodeGym, the free content gives you a good taste of whether the course will fit your Java journey.
- Learn via fictional story or educational material
- Content can be skipped based on skill level
- Completed exercises can’t be redone with different solutions
Helpful hint: check out the top five websites to learn Python for free!
- Hints available if you ever get stuck
- Solutions of other players can be viewed
- User interface design is a bit clunky and distracting with ads
6. Elevator Saga
- Allows you to get creative and continuously improve your solutions
- Speed can be increased to run through the challenges faster
- Documentation must be read on a separate page to progress
- Gameplay is unique and forces you to think outside the box
- Solutions are autosaved to the cloud as a GitHub gist
- There isn’t much practical programming to be learned
Tip: if you like to keep your programming mobile, check out some of the what to look for in a programming laptop.
Some sites didn’t make this list, as they weren’t quite game-like enough, don’t teach code, cost money, focus on young learners, or are targeted specifically to pretty advanced coders, but they deserve a mention nonetheless!
- VIM Adventures
- Hack ‘n’ Slash
- Flexbox Froggy
All these coding games do is help you practice, though. Ultimately, being a coder is about building your own things. Using sites like CodinGame and Codewars can help you keep your skills honed and growing, but after you’ve learned the basic syntax, building progressively bigger projects is the best way to keep learning.
Tip: learn what questions to ask to help you learn the fundamentals of programming.
Frequently Asked Questions
What programming language should I start learning first?
You should also consider that you must use certain languages for certain use cases. For example, Java or Koitlin are used to develop native Android apps, while Objective-C or Swift are for native iOS apps.
Can playing these games help me get a job as a software developer?
They could! If you’re a beginner, learning to code in an entertaining game format may help you stick with it long enough to get a job instead of quitting.
If you’re more advanced, check out the games that contain code puzzles and algorithmic thinking. These are more challenging and may help you develop a problem-solving mindset that’s useful for getting through programming job interview questions.
What is the best way to learn to code?
There is no single way to learn how to code. Some people learn successfully from a traditional four-year computer science degree. Others prefer to learn from things like online resources, bootcamps, or coding games like the ones mentioned in this article.
It is important to know yourself. Figure out how you like to learn: do you like reading, face-to-face communication, or learning by doing? Also, do you have strong interests or passions that you can intertwine with your coding? For example, if you like gaming, you could get far trying to program a game.
Image credit: Pexels. All screenshots by Brandon Li.
Our latest tutorials delivered straight to your inbox