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.
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
RNDandON…GOTO - A list of eight answers in a string array, picked by
RNDas 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
Ask and answer
The machine takes a question — then learns to pick its reply at random
A voice of its own
A list of answers in an array, and a pause that makes the Oracle seem to think
Mood and ceremony
Colour gives the answer a mood, and a loop turns one question into a consultation