Give the answer a rhythm
Use pauses and a counted loop to make the answer arrive deliberately.
An immediate answer and a slowly revealed answer feel different, even when their words are identical. We’ll try a brief visible rhythm, then express the repeated job with a loop.
Continue with Choose an answer, or enter this complete listing in an empty program. Keep its random selection in line 70; fixed answers are only for testing particular replies.
Repeat it by writing it again
Add lines 81–86 and 88:
5 RANDOMIZE
10 PAPER 0
20 INK 7
30 BORDER 0
40 CLS
50 PRINT "ORACLE STONE"
60 INPUT "Ask a question: ";q$
70 LET answer=INT (RND*3)+1
80 CLS
81 PRINT ".";
82 PAUSE 10
83 PRINT ".";
84 PAUSE 10
85 PRINT ".";
86 PAUSE 10
88 PRINT
90 PRINT "THE STONE SAYS"
95 INK 6
100 IF answer=1 THEN PRINT "Try a small experiment."
110 IF answer=2 THEN PRINT "Ask someone to join you."
120 IF answer=3 THEN PRINT "Take a different route."
130 INK 7
After line 80 clears the screen, PRINT "."; writes a dot. The semicolon keeps
the next printed item on the same line. PAUSE 10 waits for ten display frames
unless a key press cuts the wait short. Enter PAUSE with M after a line number.
The dot-and-pause pair appears three times. The bare PRINT at line 88 moves
printing to the next line before the answer heading.
On our 50-frame-per-second 48K target, ten frames are about a fifth of a second. The program also takes time to execute its other instructions. This is a pacing experiment, not an accurate stopwatch. Pressing a key after a pause starts can shorten it, so keep your hands off the keys while comparing the ordinary rhythm.
Run it. Watch three dots arrive before the answer. Compare with the immediate answer in the preceding lesson: does the wait make the reveal pleasant, or does it get in the way after repeated consultations?
Describe the repetition once
Replace lines 81–84 and delete 85 and 86 by entering each line number on its own. Keep line 88:
5 RANDOMIZE
10 PAPER 0
20 INK 7
30 BORDER 0
40 CLS
50 PRINT "ORACLE STONE"
60 INPUT "Ask a question: ";q$
70 LET answer=INT (RND*3)+1
80 CLS
81 FOR i=1 TO 3
82 PRINT ".";
83 PAUSE 10
84 NEXT i
88 PRINT
90 PRINT "THE STONE SAYS"
95 INK 6
100 IF answer=1 THEN PRINT "Try a small experiment."
110 IF answer=2 THEN PRINT "Ask someone to join you."
120 IF answer=3 THEN PRINT "Take a different route."
130 INK 7
FOR i=1 TO 3 gives the loop variable i the value 1. BASIC runs lines 82–83,
then NEXT i adds one and repeats the body while the loop still has a value to
visit. It uses 1, 2 and 3, then continues at line 88. Sinclair BASIC requires a
single-letter numeric variable for a FOR loop, which is why we use i here.
Enter FOR with F, TO with left Option/Alt+F, and NEXT with N after its
line number. NEXT i refers to the same loop variable as FOR i.
Foundations: Doing It Again follows a counted
loop step by step. Our loop ends with NEXT, rather than pseudocode’s END.
The principle is the same: one body, a stated number of visits.
Does this loop print 3, or print three dots?
Three dots. i controls repetition, but line 82 prints a quoted dot, not i.
Replacing that quoted dot with i would change the output, not the repeat count.
Try changing the final value in line 81 to 5. Expect five dots and a longer wait. Restore 3. To adjust the pace, change line 83 once; all three visits use the new pause. The repeated source version required three separate edits.
Mark the arrival with a sound
Add line 85:
5 RANDOMIZE
10 PAPER 0
20 INK 7
30 BORDER 0
40 CLS
50 PRINT "ORACLE STONE"
60 INPUT "Ask a question: ";q$
70 LET answer=INT (RND*3)+1
80 CLS
81 FOR i=1 TO 3
82 PRINT ".";
83 PAUSE 10
84 NEXT i
85 BEEP 0.05,0
88 PRINT
90 PRINT "THE STONE SAYS"
95 INK 6
100 IF answer=1 THEN PRINT "Try a small experiment."
110 IF answer=2 THEN PRINT "Ask someone to join you."
120 IF answer=3 THEN PRINT "Take a different route."
130 INK 7
This BEEP lasts 0.05 seconds at middle C. It runs after the loop, so we hear
one note rather than three. Enter extended mode with Shift+left Option/Alt,
release it, then press left Option/Alt+Z for BEEP.
Listen with the volume low, then try the toy muted. The dots and answer heading
still show the change. Sound is optional feedback, not the only announcement.
To remove it, enter 85 on its own; the visible sequence remains complete.

Keep the short version for the next lesson. A longer wait is not automatically more dramatic: the right length depends on what the player is waiting for and how often it happens.
Next, Write the repeated job once continues this program.
Sources
Steven Vickers, edited by Robin Bradbeer, ZX Spectrum BASIC Programming, second edition (Sinclair Research, 1983), chapter 4, “Looping”, pp. 31–34; chapter 15, PRINT; chapter 18, “Motion”, pp. 129–131; chapter 19, BEEP.