Game 1 Unit 3 of 7 1 hr learning time
More Words
Two more inputs give the story a place and a food — the mad-libs shape emerges.
43% of Story Builder
Two words make a sentence. Five words make a story.
10 BORDER 0: PAPER 0: INK 7: CLS
50 INPUT "What is your name? "; n$
60 INPUT "Name an adjective: "; a$
70 INPUT "Name an animal: "; b$
80 INPUT "Name a place: "; p$
90 INPUT "Name a food: "; f$
130 PRINT
140 PRINT n$; " found a "; a$; " "; b$
150 PRINT "hiding in "; p$; "."
160 PRINT "They fed it "; f$; "."
Lines 80 and 90 ask for a place and a food. Lines 150 and 160 weave them into the output: the animal is hiding somewhere, and somebody fed it something.
Run it. Type "Dave", "grumpy", "penguin", "Tesco", "cheese". The screen shows:
What changed
Four new lines: 80, 90, 150, 160. Line 140 changed its text slightly — "met" became "found" because the story now has a setting, not just a meeting. Everything else is the same program you had before.
Five variables now: n$, a$, b$, p$, f$. Each INPUT stores one word. Each PRINT uses them to build a sentence. The program is starting to feel like something.