Skip to content

An Unknown Wait

A fixed beat can be learnt, and a reaction test you can predict is no test. Make the wait a different length every run with RND — now the flash always catches you off guard.

  • Commodore 64
  • BASIC

There’s a flaw in the last version: the wait is always the same. Run it a few times and your finger learns the rhythm — you’re hitting the key on a count, not on the flash. A real reaction test has to catch you off guard. So make the wait a different length every single run.

wait.bas
10 PRINT CHR$(147)
20 POKE 53281,0
30 PRINT "WATCH THE SCREEN..."
40 W=INT(RND(1)*120)+60
50 FOR T=1 TO W*8:NEXT T
60 POKE 53281,1
A C64 screen, fully black, showing WATCH THE SCREEN at the top — the tense wait before the flash.
The waiting state: black, holding, no telling how long. The flash could come in half a second or in three — and that not-knowing is the whole game.

Line 40 is the new part: W=INT(RND(1)*120)+60. RND(1) hands back a fraction between 0 and 1; multiply by 120 and you have a number from 0 up to 120; INT throws the decimals away to leave a whole number; +60 shifts the range so it never drops below 60. So W lands somewhere between 60 and 180, fresh each run.

Then line 50 uses it: FOR T=1 TO W*8:NEXT T. The loop’s length now depends on W, so the wait stretches and shrinks from one run to the next. You can’t count it out any more — you can only watch, and react. That uncertainty is tension, and RND is where it comes from.

Try this

  • Widen the odds. Change 120 to 240 and the wait can run much longer — the tension stretches with it.
  • Never too quick. The +60 sets the shortest possible wait. Raise it to +120 and even the fastest flash gives you a moment to settle.

What’s next

The flash now comes when you least expect it — but the program still doesn’t know how fast you answered it. In Unit 3 you meet the C64’s clock, TI, and start measuring the gap between the flash and your key.

Run it here

This unit's program, built for you.

Program
wait.prg
Machine
Commodore 64 (PAL Breadbin)

Download wait.prg