Skip to content

Sonar

Spectrum · BASIC

Choose probes, combine clues and discover a hidden object

10 units

Start with A sea to search Browse lessons
Sonar course capture
Sonar · Spectrum

One object is hidden in an 8×8 sea. Choose a row and a column, send a probe, and use its reading to decide where to search next. Earlier clues stay on the board. You can take as long as you need.

The distance rule counts rows plus columns. N means near, one or two steps away; M means medium, three or four; F means far, at least five. An asterisk marks a discovery. A reading tells you a distance band, not a direction.

Press a row number, then a column number: each is a single key, with no Enter. The > marker shows your latest probe. Repeated probes do not increase the count. After finding the object, R begins another round and Q leaves; Q also works at the coordinate prompts.

An 8 by 8 Sonar board with retained near and medium readings and a discovered target.
A completed search. Earlier readings remain visible beside the discovery.

We start with a visible target, so we can check the coordinates before hiding anything. Exact distances explain the calculation; then we group them into bands. A two-dimensional array remembers what the player has discovered, while two separate variables keep the hidden target.

The game runs in Sinclair BASIC on a stock 48K ZX Spectrum. It uses coloured character cells, keyboard input and tape saving, and is deliberately silent. A compatible emulator is suitable for following the lessons.

Touchdown used one array position per terrain column. Here we use both a row and a column. If you are joining at Sonar, the lessons explain the loops, routines, coordinate calculations and input checks where they are used; you do not need to reconstruct a previous game’s program.

The lessons

  1. A sea to search: build the labelled board.
  2. Send a probe: validate coordinates and test a cell.
  3. Measure the distance: calculate a useful clue.
  4. Read the sonar: reveal near, medium or far.
  5. Remember the clues: record the search in an array.
  6. One probe, one count: recognise repeats and rebuild the display.
  7. A complete round: add instructions, discovery and retry.
  8. Search somewhere new: choose random targets.
  9. Keep your game: save, reload and check the whole game.
  10. One key, one choice: read each coordinate as a single key press.

A quick discovery can still be a satisfying one. The interesting question is what each clue lets you rule out, and what you choose to ask next.