Digger · playable

Digger

A tribute to the 1983 DOS classic — built in one session with Claude Code

I played Digger (Windmill Software, 1983) as a kid on DOS, and I always wanted to build it. Roughly 25 years into this industry, I finally did — in a single session, directing Claude Code.

This is a tribute, not the original: the rules come from Wikipedia’s description of the game, and the six level layouts are original designs. The original Digger went open source in 1998 (Digger Remastered is its free-software remake); credit for the game itself belongs to Windmill Software.

660×468 canvas · scales to fit · touch controls on phonesPlay full screen ↗Watch the AI play ↗

The game

A 15×10 dirt grid you tunnel through. Emeralds are worth 25 each — or a 250 bonus for taking 8 in quick succession. Gold bags wobble when undermined, fall, crush monsters (or you), and break into gold worth 500 after falling two or more rows. Nobbins stay in the tunnels; Hobbins dig through dirt and destroy emeralds and bags on the way. You get a fireball with a recharge time, and once every monster has spawned, a cherry appears: 1,000 points and bonus mode, where you eat the monsters for 200, 400, 800 and so on. An extra life every 20,000 points. Six levels with their own dirt colours and rising difficulty; keyboard on desktop, touch controls on phones.

The sound is generated in the browser — a WebAudio chiptune. Bonus mode plays Rossini’s William Tell Overture and dying plays Chopin’s Funeral March, both public domain. The original’s “Popcorn” theme was left out on purpose: it is still under copyright.

How it was tested

First, a headless Node simulation played thousands of random ticks and cleared 31 levels in a row (with forced level completions), checking game invariants along the way. Then Claude opened the game in my Chrome and actually played it with a small autopilot script, clearing levels 1–3. That play-test found two real bugs, both fixed: a PAUSED banner overlapping the “GET READY” banner, and bonus mode being nearly invisible on the blue level.

The AI watch mode

Watching the autopilot clear levels was the best part — seeing an AI agent play against the game and clear levels is something else altogether — so it became a built-in watch mode. Press I in the game (or open the AI link below) and the machine plays.

How it thinks: each move it plans the cheapest route over the grid with Dijkstra’s algorithm. Cells within a step of a monster are off-limits, cells two steps away are expensive, and columns under wobbling or falling gold bags are avoided. It turns and fires at monsters lined up in a clear tunnel, goes for gold and the cherry only if it can arrive before they vanish, hunts monsters in bonus mode while there is time, sticks with its current target so it doesn’t dither, and unsticks itself when blocked.

What you see: its planned route as a dotted line, a bracket on its target, red shading on danger cells, and a live caption — “GOING FOR EMERALD”, “FIRE!”, “EVADING!”, “CHERRY! BONUS TIME”.

In 80 simulated minutes it averaged about 23,000 points per game, usually reached level 9 (twice level 11), killed 30–50 monsters per game, and triggered bonus mode fairly often. It starts losing around level 9, when the monsters get as fast as the digger.

Controls

  • Arrow keys / WASD — move · Space / F — fireball · P — pause
  • I — switch between you and the AI · 1 / 2 / 3 — AI speed 1×/2×/4× · V — toggle the AI’s route overlay
  • Idle 20 seconds on the title screen and a demo game starts, arcade style. The AI keeps its own “AI BEST” score, separate from yours.
The AI clearing level 5 at 14,125 points, no lives lost.
The AI clearing level 5 at 14,125 points, no lives lost.
Level 6, mid 8-emerald chain — planned route, target marker and the “EMERALD CHAIN ×7” caption.
Level 6, mid 8-emerald chain — planned route, target marker and the “EMERALD CHAIN ×7” caption.

Digger was created by Windmill Software (1983) and went open source in 1998. This page is an original-code, original-layout tribute built for the love of it.