Skip to content
Game 1 Unit 1 of 7 1 hr learning time

Asking Questions

Story Builder's first move: ask the player for a word and remember it. You met INPUT and PRINT in Meet BASIC — here they start building a game.

14% of Story Builder

This is your first game. Story Builder asks the player for a handful of words — a name, an adjective, an animal — and weaves them into a ridiculous little story it reads back. A mad-libs machine. By the end it has a title, colour, and a flourish; right now it just needs to start listening.

You met INPUT, PRINT and string variables in Meet BASIC. Here they do real work — the game's first question:

  10 BORDER 0: PAPER 0: INK 7: CLS
  50 INPUT "What is your name? "; n$
 130 PRINT "Hello, "; n$

Run it. The screen goes black, shows What is your name?, and waits. Type a name and press Enter — it greets you.

The Spectrum screen showing: Hello, Dave
A name in, a greeting out — the seed of the whole game.

How it works

Three lines, three jobs. Line 10 sets the stage — black BORDER and PAPER, white INK, then CLS to paint the screen. Line 50 asks the question and stores the answer in n$. Line 130 greets whatever the player typed. (The single-letter $ name n$ is the Sinclair rule from Meet BASIC — text variables are one letter plus a dollar.)

Room to grow

Look at the gaps in the numbering: setup on 10, the question on 50, the greeting on 130. That space is deliberate. Story Builder grows by slipping new lines into the gaps — more questions between 50 and 130, a title between 10 and 50 — without renumbering a thing. It's the number-in-tens habit from Meet BASIC, now earning its keep on a real program.

Next, more questions — and the words start combining.