ThisCalculator

Everyday

Best Online Hacking Games to Learn Programming

Updated · Standard formula, shown below

Best Online Hacking Games to Learn Programming

If you want to learn programming while having fun, the top pick is Screeps—it’s a real-time strategy game where you write actual JavaScript to control your units, and the code you write is the only way to play. Unlike puzzle-style games that teach isolated concepts, Screeps forces you to build a working codebase, debug it, and optimize it, which is exactly how real programming works.

What to Look For

Not all “hacking” games teach programming equally. Here are the criteria that actually matter:

  • Real code vs. pseudo-code: Games that use actual programming languages (JavaScript, Python, etc.) give you transferable skills. If the game uses its own drag-and-drop blocks or made-up syntax, you’ll learn logic but not a language.
  • Depth and complexity: A good learning game should have a progression from simple tasks to complex systems. Look for games that require you to manage state, handle errors, and design algorithms—not just solve one-off puzzles.
  • Feedback and debugging tools: You need to see why your code fails. A game with a console, logs, or step-by-step execution helps you learn faster.
  • Community and documentation: A strong community means tutorials, example code, and help when you’re stuck. Documentation is essential for learning the game’s API.
  • Cost vs. value: Some games are free, others are paid. Consider whether the game offers enough content and learning value for the price.

Screeps

Strengths: Screeps is the gold standard for learning JavaScript through gaming. You write real JavaScript (or TypeScript) to control creeps (units) that harvest resources, build structures, and defend your colony. The game runs in real time, so your code must be efficient and handle asynchronous events. It teaches you about loops, state machines, pathfinding, and even basic AI.

Trade-offs: The learning curve is steep. If you’re a complete beginner, you’ll be overwhelmed. The game requires a server subscription after the first few months (though there’s a free tier with limited CPU). It’s not a casual game—it’s a serious coding challenge.

Who it suits: Best for people who already know basic programming (any language) and want to practice JavaScript in a fun, persistent world. If you’re a complete newbie, start with something easier first.

Untrusted (The Moral Code)

Strengths: Untrusted is a free, browser-based puzzle game that teaches JavaScript through a series of levels. Each level presents a JavaScript environment where you must modify the code to escape a room or achieve a goal. It’s excellent for learning syntax, functions, and problem-solving with real code.

Trade-offs: The game is relatively short (about 20 levels) and doesn’t cover advanced topics like data structures or algorithms. It’s more about learning to read and manipulate existing code than writing from scratch.

Who it suits: Perfect for beginners who want a gentle introduction to JavaScript without any setup. It’s also great for brushing up on problem-solving skills.

Elevator Saga

Strengths: Elevator Saga is a free, open-source game where you write JavaScript to control elevators in a building. You need to move people efficiently, which teaches you about queues, scheduling, and optimization. It’s a great way to practice writing functions and thinking about performance.

Trade-offs: It’s a single, focused challenge—there’s only one scenario (elevators). The game doesn’t teach broader programming concepts, and the UI is minimal. It can get repetitive after a while.

Who it suits: Great for intermediate programmers who want to practice algorithm design and optimization. It’s also a fun way to learn about event-driven programming.

Vim Adventures

Strengths: Vim Adventures is a browser-based game that teaches you the Vim text editor through a puzzle-adventure format. While not strictly a “hacking” game, Vim is an essential tool for many programmers, and the game makes learning it fun. You navigate through levels using Vim keybindings, which builds muscle memory.

Trade-offs: It teaches Vim, not a programming language. If you don’t plan to use Vim, the skills are less directly applicable. The free version has limited levels; the full game requires a one-time purchase.

Who it suits: Ideal for programmers who want to become more efficient in a text editor. It’s also a fun way to learn if you’re curious about the hacker aesthetic.

CodeCombat

Strengths: CodeCombat is a gamified platform that teaches Python, JavaScript, and other languages through a fantasy RPG. You control a hero by writing code to defeat enemies and solve puzzles. It has a structured curriculum, making it great for beginners. The free version covers the first few levels, and the paid version unlocks more.

Trade-offs: The game can feel more like a tutorial than a true game. Some levels are repetitive, and the “hacking” theme is superficial. The paid subscription is required for advanced content.

Who it suits: Best for absolute beginners, especially kids or teens, who want a fun, guided introduction to programming. It’s also useful for teachers.

Hack The Box (HTB) & OverTheWire

Strengths: These are not games per se, but gamified cybersecurity challenges. OverTheWire’s Bandit is a series of SSH-based puzzles that teach Linux command-line basics and simple scripting. Hack The Box offers a more advanced platform with vulnerable machines to exploit, which requires knowledge of networking, web vulnerabilities, and scripting. Both are free (HTB has a free tier).

Trade-offs: They focus on security, not general programming. You’ll need to learn Linux and networking basics first. The challenges can be frustratingly difficult, and there’s no hand-holding.

Who it suits: Perfect for those interested in cybersecurity or who want to learn scripting (Bash, Python) in a practical context. Best for intermediate to advanced users.

How to Choose

Budget: Many great options are free (Untrusted, Elevator Saga, OverTheWire). If you’re willing to pay, Screeps offers the deepest experience, while CodeCombat provides a structured curriculum for a subscription fee. Vim Adventures is a one-time small purchase.

Use case: If you’re a complete beginner, start with CodeCombat or Untrusted to learn syntax. If you already know programming and want to practice, Screeps or Elevator Saga are excellent. If you’re interested in cybersecurity, go with OverTheWire or Hack The Box.

Common trade-offs: The main trade-off is between fun and depth. Games like CodeCombat are fun but shallow; Screeps is deep but not casual. Also, consider the language: if you want to learn Python, CodeCombat is a good choice; if JavaScript, Screeps, Untrusted, and Elevator Saga are better.

Frequently Asked Questions

Do I need to know programming before playing these games?

For CodeCombat and Untrusted, no. For Screeps and Hack The Box, yes—you should know at least the basics of JavaScript or Python and general programming concepts.

Can I learn a programming language entirely from a game?

No. Games are a supplement, not a replacement. You’ll need to read documentation, do exercises, and build projects to become proficient. Games help with practice and motivation.

Are these games suitable for kids?

CodeCombat is specifically designed for kids. Untrusted is also kid-friendly. Screeps and Hack The Box are too complex for most kids.

Which game is best for learning JavaScript specifically?

Screeps is the most comprehensive, but it’s advanced. Untrusted is a great starting point. Elevator Saga is good for practicing algorithms in JavaScript.

Are there any free games that teach Python?

CodeCombat has a free tier that includes Python. OverTheWire challenges can be solved with Python scripts, but they don’t teach Python directly.

How much time do I need to see results?

It depends on the game and your dedication. For Untrusted, a few hours will give you a solid grasp of JavaScript basics. For Screeps, expect weeks to build a functional colony.

Bottom Line

For most people, Untrusted is the best starting point because it’s free, browser-based, and teaches real JavaScript with immediate feedback. If you’re already comfortable with coding and want a serious challenge, Screeps is the most rewarding investment. And if you’re a complete beginner, CodeCombat provides the gentlest introduction. Pick based on your current skill level and how much time you’re willing to invest.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.