One Question
Display a multiple-choice question on the game screen, take an answer with INPUT, and check it.
Over the next eight units you’ll build Quiz Master — a quiz with four categories, colour-coded feedback, and a scoreboard at the end. It’s the most polished Foundations game because the code is structured enough to support polish. But first: one question.
The Question Card
5 BORDER 0: PAPER 0: INK 7: CLS
10 FOR i=0 TO 31
12 PRINT AT 0,i; PAPER 2;" "
14 NEXT i
16 PRINT AT 0,9; PAPER 2; INK 7; BRIGHT 1;" QUIZ MASTER "
20 PRINT AT 4,4; INK 7;"Closest planet to the Sun?"
30 PRINT AT 8,6; INK 7;"A: Mercury"
32 PRINT AT 10,6; INK 7;"B: Venus"
34 PRINT AT 12,6; INK 7;"C: Earth"
36 PRINT AT 14,6; INK 7;"D: Mars"
40 PRINT AT 18,4;
42 INPUT "Your answer (a/b/c/d)? ";k$
44 IF k$="a" THEN PRINT AT 18,4; INK 4; BRIGHT 1;"Correct!": STOP
46 PRINT AT 18,4; INK 2; BRIGHT 1;"Wrong! It was A"

The red header bar says “QUIZ MASTER”. Below it, a question and four options labelled A-D. The INPUT prompt waits at the bottom. It looks like a quiz show from the first run.
The flow is simple:
- Line 20 prints the question at row 4
- Lines 30-36 print the four options, evenly spaced
- Line 42 takes the player’s answer into
k$ - Line 44 checks if
k$equals"a"— if yes, green “Correct!” and STOP - Line 46 runs only when the answer is wrong — red “Wrong!”
This is the same IF/GO TO branching pattern from every previous game. The correct path stops the program. The wrong path falls through to the next line.
String Comparison Again
IF k$ = "a" compares two strings. The player must type lowercase “a” — “A” won’t match. This is the same case-sensitivity you met in Word Scramble. We’ll fix it properly in a later unit when we switch from INPUT to INKEY$.
Try This
Change the question. Replace the DATA with your own question and options. Make sure the correct answer letter on line 44 matches your right option.
Add “The answer was…” After the “Wrong!” message, print which option was correct: 48 PRINT AT 20, 4; INK 7; "The answer was A: Mercury". The player learns from mistakes.
What You’ve Learnt
- Question card layout — header bar, question, four labelled options
- INPUT for strings —
INPUT "prompt"; k$reads a letter - Branching —
IF k$ = "a" THEN ... STOPskips the wrong path