Skip to content
Game 3 Unit 1 of 6 1 hr learning time

Ask the Oracle

Oracle Stone is a toy: ask a yes-or-no question, and the stone answers. The new trick is selection — chaining IF/THEN on a random number to pick one of ten pre-written answers. You know the parts; here's the pattern that ties them together.

17% of Oracle Stone

Oracle Stone isn't a game — it's a toy. You ask a yes-or-no question, the stone thinks, and it answers. The answer is random, but the ceremony of asking makes it feel deliberate. You already know INPUT, RND, and IF/THEN from Meet BASIC and Lucky Number. The one new idea is how to put them together: selection.

  10 BORDER 1: PAPER 1: INK 7: CLS
  20 RANDOMIZE
  40 PRINT "  *** THE ORACLE STONE ***"
  50 PRINT
  60 PRINT "  Ask any yes-or-no question."
  90 INPUT "  Speak, mortal: "; q$
 200 LET r = INT (RND * 10) + 1
 230 IF r = 1 THEN PRINT "  YES"
 240 IF r = 2 THEN PRINT "  NO"
 250 IF r = 3 THEN PRINT "  PERHAPS"
 260 IF r = 4 THEN PRINT "  ASK AGAIN LATER"
 270 IF r = 5 THEN PRINT "  THE SIGNS ARE UNCLEAR"
 280 IF r = 6 THEN PRINT "  DEFINITELY NOT"
 290 IF r = 7 THEN PRINT "  THE STARS SAY YES"
 300 IF r = 8 THEN PRINT "  NOT ON A TUESDAY"
 310 IF r = 9 THEN PRINT "  THE ORACLE IS UNSURE"
 320 IF r = 10 THEN PRINT "  WITHOUT A DOUBT"
A blue ZX Spectrum screen: the title THE ORACLE STONE, the prompt, and the answer YES.
Ask, and the stone answers. The verdict this time: YES. Run it again and the answer changes.

The selection pattern

Line 200 rolls a random number from 1 to 10. Then lines 230–320 are ten IFs in a row, each checking for one value of r and printing one answer. Exactly one of them is true, so exactly one answer prints.

That's the selection pattern: a random number, then a chain of IFs that turns it into a choice. You'll reach for it constantly — a random enemy, a random room, a random line of dialogue. It's how a program picks one thing from a set. (INPUT reads the question into q$; the Oracle ignores it, but asking out loud is half the magic.)

Writing good answers

The Oracle's power is in the answers, and the best ones are confidently vague. "YES" fits any question. "ASK AGAIN LATER" fits any question. "THE SIGNS ARE UNCLEAR" fits any question. Avoid specifics like "YOU WILL GET A DOG" — they only work for one question and break the spell. Vague, certain, and a little mysterious: that's an Oracle answer.

The toy works already. Everything from here is ceremony — making it feel less like a program printing a line and more like a stone delivering a verdict.

Next: the Oracle learns to take its time.