>_ program-games.org
browse games
Guide

Games Where You Write Real Code (Not a Toy Language)

The best programming games that use real languages and APIs, including JavaScript, Python, Java, Rust, SQL and HTTP-based games you can automate from any stack.

Games Where You Write Real Code (Not a Toy Language) article hero image

Some programming games teach with blocks or fictional assembly. Others hand you a real language, a real API and a problem that keeps pushing back. If you want practice that transfers directly to your editor, these are the games where you write actual code.

## Why real-code games feel different

A real-code game changes the learning loop. You are no longer only solving a puzzle inside a contained interface; you are learning how to read documentation, organize files, name functions, handle async behavior, inspect state and decide when a quick script should become a small system. That is why these games can be so sticky for working developers and ambitious beginners.

The transfer is not just syntax. In Bitburner, a weak early hacking script naturally grows into scheduling, process management and server discovery. In Screeps, a simple creep role becomes pathfinding, memory layout, spawning policy and defense. In API games such as SpaceTraders or Artifacts MMO, you quickly meet the same concerns that appear in production integrations: authentication, rate limits, retries, cooldowns and state storage.

The trade-off is that real-code games can be less gentle. Error messages may be real error messages. The API may expect you to read. A blank file can feel intimidating. But if your goal is to become more comfortable writing code outside tutorials, that friction is exactly the point.

## Best games where you write real code

Screeps: World — mmo / rts programming game screenshot
Screeps: World★ 4.7

An open-source MMO RTS where your units are driven by JavaScript you write — and the world keeps running 24/7, even while you sleep.

View ↗
Bitburner — incremental programming game screenshot
Bitburner★ 4.6

A programming-based incremental: script your way through a cyberpunk net, automate hacking with a NetScript API, and break the simulation.

View ↗
The Farmer Was Replaced — automation programming game screenshot
The Farmer Was Replaced★ 4.8

Program a drone to automate an entire farm. Plant, harvest, optimise — then watch your code outgrow you.

View ↗
SpaceTraders — api game programming game screenshot
SpaceTraders★ 4.5

A multiplayer game with no UI of its own: you automate a trading fleet entirely through an HTTP API in any language.

View ↗
Battlecode — ai competition programming game screenshot
Battlecode★ 4.7

MIT’s annual AI programming competition. Command an army of bots with distributed strategy and battle other teams for the title.

View ↗
Robocode — bot arena programming game screenshot
Robocode★ 4.5

Build a robot tank, code its brain in Java or .NET, and drop it into the arena. The classic that taught a generation to program by battling bots.

View ↗

Screeps is the flagship for real JavaScript in a persistent game world. Bitburner is the easiest free recommendation because the scripting loop starts simple and scales naturally. The Farmer Was Replaced is ideal for Python-minded players who want a concrete automation playground. SpaceTraders is pure API play: no traditional client, just requests and decisions. Battlecode and Robocode are stronger if you want competition and the pressure of other people’s bots.

## Best picks by language

For JavaScript, start with Bitburner if you want low-friction scripting and Screeps if you want a serious long-term project. CodinGame also supports JavaScript, but its strength is language breadth and puzzle variety rather than one persistent codebase.

For Python, CodeCombat and CheckiO are friendlier learning environments, while The Farmer Was Replaced gives a more automation-heavy loop. CodinGame and Battlecode can also be good Python practice if you prefer competition and algorithms.

For Java and C#, Robocode remains the classic robot arena. Tank behavior, radar scanning and event handlers make object-oriented ideas feel useful instead of abstract. For Rust, Oort and some bot competitions are the better fit because they reward performance-minded, systems-style thinking.

For SQL, SQL Murder Mystery, SQL Island and The Schemaverse prove that a query language can be a game controller. They are especially useful because SQL practice often feels dry until there is a story, a map or an opponent attached to the tables.

## A first bot should be boring

The first useful program in a real-code game should usually be boring. Make one unit move. Make one request. Solve one case. Print the state. The mistake beginners make is trying to design the final architecture before they have watched one tiny loop succeed and fail.

main.jsjavascript
module.exports.loop = function () {
  for (const name in Game.creeps) {
    const creep = Game.creeps[name];
    if (creep.store.getFreeCapacity() > 0) {
      const source = creep.room.find(FIND_SOURCES)[0];
      if (creep.harvest(source) === ERR_NOT_IN_RANGE) creep.moveTo(source);
    } else {
      const spawn = Game.spawns.Spawn1;
      if (creep.transfer(spawn, RESOURCE_ENERGY) === ERR_NOT_IN_RANGE) creep.moveTo(spawn);
    }
  }
};

This is not a finished Screeps AI. That is the lesson. A useful first bot is a scaffold: it proves you can inspect state, choose an action and let the game execute it. After that you can split roles, add memory, handle empty sources, build roads, spawn replacement workers and measure CPU.

## How to learn faster from real-code games

  • Keep a notes file of API calls you actually used, not every call in the docs.
  • Name the problem before refactoring: pathing, scheduling, targeting, economy, cooldowns or state.
  • Watch replays or logs before changing code; do not guess blindly.
  • Prefer one clear improvement per run so you know what changed.
  • Read community solutions only after your own version works at least once.
NOTE
Real-code games are best treated like small projects. Version your scripts, keep experiments separate and write down why a strategy failed. That habit is more valuable than any single trick.

## Who should start elsewhere

If you have never written a loop, a real-code sandbox may feel like too much at once. Start with Human Resource Machine, Lightbot, Flexbox Froggy or CodeCombat before jumping into an API-heavy game. The goal is momentum, not proving you can suffer through setup.

If you already code professionally, the opposite is true: choose the game that gives you a messy system. Screeps, Bitburner, SpaceTraders and Robocode stay interesting because they eventually stop being “levels” and become little engineering environments.

LO
Written by Lena Ortmann
Editor · plays too much TIS-100

Lena reviews and breaks down programming games for program-games.org. She has shipped bots to three different Screeps shards and still loses to her own old code.

// games mentioned

// keep reading