In this project you will write a program that plays the game Mad Libs. Mad Libs involve a story or essay with important words left out. Players unaware of the text are asked to fill in the blanks with words with the given parts of speech. (Often something more specific is asked for, such as "past tense verb," "proper noun," or even "food.")
If you haven't yet made a directory for this class
(if your partner has been the one logged in for each of the labs),
make one now.
Move into your cs235
directory,
make a directory for this project, and change into it.
cd cs235 mkdir proj1 cd proj1
Start Xemacs, giving as an argument the file named something like "MadLibs.java".
xemacs MadLibs.java &
Write or find a story or other text that can be changed into a Mad Lib. Write a program that asks the user for a series of words, for example,
noun--> computer past tense verb--> walked interjection--> splat ...
Then display the story or essay with the words filled in the right place. Your program should meet the following specifications:
litfin
for a proper noun, it should appear in
your story as Litfin
.
If the user enters wAlRuS
and it is not at the beginning of
a sentence, it should appear as walrus
.
And of course, practice the documentation guidelines we talked about in class.
When you are all finished and are confident that your program fulfills all the instructions here and is working right, perform the usual turn-in procedure.
.class
files.
cat
Then print the script file.
a2ps -P sp (the name of the script file)
Then turn in the hard copy in class or put it in my box.
DUE: Friday, Jan 26, at 5:00 PM.