Skip to content
C64 · BASIC · Game 06 BASIC ● 6 of 6 units live

Safe Cracker

The C64 hides a code; you close in on it, guess by guess, the safe answering higher or lower and the screen warming as you near it — but your guesses are numbered. Meet the loop-with-a-goal: a loop that ends in a win or a loss, the structure under every game from here on.

In Bleeper the machine tested your memory. Here it tests your reasoning. Safe Cracker hides a number behind a locked door; you guess, and the safe tells you whether the code is higher or lower, the screen warming toward red as you close in. The trick at its heart is deduction: every answer narrows the hunt, and a careful cracker needs only a handful of tries — but tries are exactly what you're short of.

A C64 screen with a green background: a safe drawn in asterisks, GUESSES LEFT: 2, and CRACKED IT! below it.
Where you're headed: a safe that answers in colour and words, a guess count ticking down, and the green flash of a crack — opened here with two guesses to spare.

This is the game where you meet the loop-with-a-goal — not a FOR loop that counts to a fixed number, but a loop that runs until something happens: the safe cracks, or the guesses run out. Two ways to end, win and lose. Every game you build after this — Rover's finish line, Dropzone's landing — is built on that shape.

What you'll build:

  • A hidden code the machine picks with RND
  • A guess taken with INPUT and weighed against the secret
  • A higher-or-lower hint that turns a miss into a direction
  • A loop that runs until the safe is cracked
  • Colour feedback — the background warming red or cooling blue before the words
  • A guess limit and a lose state, so the safe can stay shut

6 units. About 6–8 hours. This follows Bleeper and builds on Meet C64 BASIC.

Unit roadmap

Phase 1

The secret and the guess

The machine hides a number; you put one against it and learn if it's right

Units 1–2 Complete
Phase 2

Closing in

Higher or lower turns a miss into a direction, and a loop lets you narrow

Units 3–4 Complete
Phase 3

A safe with stakes

Colour carries the safe's mood, and a guess limit makes the safe losable

Units 5–6 Complete