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

Ask the Oracle

The Oracle's whole shape in four lines: the machine takes a question with INPUT, and gives an answer. For now the answer is always YES — but ask, then answer, is the ceremony everything else hangs on.

17% of Oracle

Every fortune-teller does the same two things: it takes your question, and it gives you an answer. That's the whole shape of Oracle, and you can build it in four lines. The answer won't be wise yet — it's always YES — but the ceremony is what matters first.

10 PRINT CHR$(147)
20 INPUT "SPEAK, MORTAL";Q$
30 PRINT
40 PRINT "THE ORACLE SAYS... YES"
A C64 screen: SPEAK, MORTAL? WILL IT WORK, then THE ORACLE SAYS... YES.
Ask, then answer. INPUT takes the question; PRINT gives the reply. The answer is always YES — for now.

INPUT "SPEAK, MORTAL";Q$ does the asking: it prints the prompt, waits for the player to type, and stores whatever they type in the string variable Q$. (The Oracle never reads the question — but the ritual of typing it is half the fun.) Then PRINT gives the answer.

The prompt is doing real work, too. INPUT "SPEAK, MORTAL" has more menace than INPUT "TYPE YOUR QUESTION" — same code, different character. The Oracle's voice starts here.

Try this

  • Change its voice. Rewrite the prompt — "WHAT TROUBLES YOU?", "ASK, AND BE ANSWERED" — and feel how the personality shifts.
  • A grander answer. Swap YES for IT SHALL BE SO. The Oracle should never sound like a person.

What's next

An Oracle that always says YES is no Oracle at all. In Unit 2 it learns to chooseRND picks between two answers, and the player stops knowing what's coming.