Lesson 9: Mad Libs

So far, we have taught the turtle to draw pictures. In this lesson, we are going to do something a little different. Instead of drawing pictures, we are going to teach the turtle to tell a story. The story is going to be a Mad Libs. This means that most of the story is already made up, but some of the words are left blank so that we can fill them in.

Mad Libs

Mad libs are stories where the main characters (and other words) are left blank. We fill in the blanks with our own words without reading the story. The resulting story is often silly nonsense, but it's not gibberish.

Let's start with an example:

Activity: Fill in the blank in as many different words that you can think of that "fit" the sentence.

Spiderman is very _________.
                  adjective

What do all of the words that you used have in common?

Are there any words that you can't use?

How does the sentence feel if you use the word "cool"? What about "yellow"? What about "table"?

Parts of Speech

A "Part of Speech" is a way of grouping words that have similar uses. For example "run", "catch", "throw", and "kick" are all action words. Some parts of speech are given in the table below.

Part of Speech Description Examples
noun a person, place, or thing Spiderman, Bellevue, table
verb an action word run, catch, throw, kick
adjective words that describe nouns fast, tall, slow, strong
adverb words that describe verbs quickly, slowly, very

Activity:
  1. Click on the EDALL button.
  2. Copy the following code into the EDALL window.
  3. Replace the words "slow, "fast, "steady, "short", "feet, "race, "Hare, and "Tortoise with your own words. Be sure to choose a word with the same part of speech.
  4. Save and Exit the EDALL window.
  5. Run MADLIBS.
TO MADLIBS
  LOCALMAKE "adjective1 "slow
  LOCALMAKE "opposite1  "fast
  LOCALMAKE "adjective2 "steady
  LOCALMAKE "adjective3 "short
  LOCALMAKE "bodypart   "feet
  LOCALMAKE "contest    "race
  LOCALMAKE "loser      "Hare
  LOCALMAKE "winner     "Tortoise

  SHOWSTORY
END

TO SHOWSTORY

  PRINT (LIST
"\

"One "day, "a :loser "made "fun "of "the "\

:adjective3 :bodypart "and :adjective1 "pace "of "\

"a :winner ".\

"The :winner "replied: ""Even "though "I\

"have :adjective3 :bodypart ", "I "will "beat\

"you "in "a :contest "."\

"The :loser "thought "that "this "was "impossible.\

"So "he "challenged "the :winner "to "a :contest ".\

"On "the "day "of "the :contest "the "two\

"started "together.\

"The :winner "never "stopped "for "a "moment,\

"but "went "on "with "a :adjective1 "but :adjective2 "pace.\

"The :loser "lied "down "and "fell "asleep.\

"When "the :loser "woke "up,\

"he "went "as :opposite1 "as "he "could, "but "the\

:winner "had "already "won "the :contest "\

"and "was "comfortably "dozing.\

"\

"The "moral "of "the "story "is\

:adjective1 "and :adjective2 "wins "the :contest ".\

)

END

There are some commands in the Mad Libs program that we have never seen. Here's what they do.

Command Example What Happens
LOCALMAKE name value LOCALMAKE "length 100 Creates a variable named :length and assigns it the value 100.
PRINT list PRINT [Hello World!] Displays "Hello World!" in the Commander window.
LIST value1 value2 ... (LIST "Hello "World!) Creates a list from whatever follows it. Each element is evaluated before being put into the list.

Activity: Write your own Mad Libs using the program above as a model. You can use a well-known story or make one up yourself. Just be sure to replace some of the words with blanks.

When you are done, give the program to a friend and let them fill in the blanks with their own words.