Skip to content
C64 · BASIC · Game 02 BASIC ● 6 of 6 units live

Oracle

Ask the machine a yes/no question and it answers — and you never know which answer is coming. Meet RND as a decision-maker, a string array as a memory of replies, a thinking pause that builds suspense, and colour that gives each answer a mood.

In Skyline the machine drew. Here it answers. Oracle is a fortune-teller: you type a yes/no question, the C64 mulls it over, and a reply appears — one of many, picked at random, dressed in a mood. The trick at its heart is chance: you write every answer, but the player never knows which one is coming.

A C64 screen with a green border: the question WILL I BE RICH and the Oracle's green answer IT IS CERTAIN.
Where you're headed: a question, a pause while the Oracle thinks, and an answer that arrives in a mood — green for yes, red for no — ready to ask again.

This is your first program that makes a decision. RND is the decision-maker, and you'll meet it twice: first to pick between answers, then as an index into a whole list of them. A pause and a tone make the Oracle seem to think; colour gives each reply a feeling; and a loop turns a one-shot program into something you consult.

What you'll build:

  • A question the machine takes with INPUT, and a single fixed answer
  • A reply chosen at random with RND and ON…GOTO
  • A list of eight answers in a string array, picked by RND as an index
  • A thinking pause — a delay and a SID tone — that builds suspense
  • A mood in colour: green for yes, red for no, set before the words appear
  • An ask-again loop, so one sitting holds many questions

6 units. About 5–6 hours. This follows Skyline and builds on Meet C64 BASIC.

Unit roadmap

Phase 1

Ask and answer

The machine takes a question — then learns to pick its reply at random

Units 1–2 Complete
Phase 2

A voice of its own

A list of answers in an array, and a pause that makes the Oracle seem to think

Units 3–4 Complete
Phase 3

Mood and ceremony

Colour gives the answer a mood, and a loop turns one question into a consultation

Units 5–6 Complete