0% found this document useful (0 votes)
6 views1 page

Mad Libs

Uploaded by

huang54778
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Mad Libs

Uploaded by

huang54778
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Unit 2: Using Objects

Coding Project

Mad Libs
Mad Libs are stories with certain words removed. One player acts as the “reader” and asks the other players,
who haven’t seen the story, to fill in the blanks with adjectives, nouns, colors, adjectives, and more. These
words are inserted into the blanks and then the story is read aloud to hilarious results.

Your mad libs program will ask for certain kinds of words in the story. The user will enter all the required
pieces of the story as a single line. Your program will then take apart that line, get the words it needs, and then
insert it into the mad libs story.

Here are some words you can ask for to make your story work:

• Noun – ask for a person, place, or thing (identify if it should be plural)


• Verb – an action (identify if it should end in –ing or –ed)
• Adverb – describes an action and usually ends in –ly
• Adjective – describes a noun

You are going to create your own "Mad Lib" program that asks the user to input (minimum) 6 words, in the
format word, word, word, word, word, word

The user will enter in a single string of words, separated by a comma then a space. Place the answers in the
spots in the Mad Libs script that you create. Make sure to ask for the words out of order from the story, so the
user does not know what sort of story they are creating.

You can create your own story, or use the template below

It was a <adjective> day in AP Computer Science A, when <teacher> burst in the doorway. They started
singing <song> while <student> <verb-ed> with them. The whole class clapped as <student> did their signature
dance move: the <adverb> <verb>.

This template is used in the example run. The words in bold are what the user entered.

Welcome to Mad Libs!


Enter in the following, separated by a comma and a space:
Verb, Verb (with -ed), teacher name, adjective, song title, student name,
adjective
gobble, talked, Mr. Smith, affectionate, Shake It Off, Nolan, beautiful

It was a affectionate day in AP Computer Science A, when Mr. Smith burst


in the doorway. They started singing Shake It Off while Nolan talked with
them. The whole class clapped as Nolan did their signature dance move: the
beautiful gobble

You might also like