This assignment is worth 10 points.
In addition, it might be useful to know that this script:
<script type="text/javascript"> let note = "Hello from the Script!"; document.write("<p>", note, "<p>"); </script>Produced this output
Write a very simple mad lib game. At a minimum, use the prompt command to get input and the document.write example above to produce output.
You should read the story from a file. The format of a file is
#i
where $0 \le i \lt n$.
5 a name a color a thing a place an animal <h1>The Story of #0 </h1> One day #0 decided to go to #3 to look for a #1 #2 they had lost. When #0 got to #3 the #1 #2 was not there. #0 was sad and went home. When #0 got home, they found that the #1 #2 was there so #0 was happy after all. #0 loaded his pet #4 into the #2 and went back to #3 just to show off.Assuming the user provided the following input
Bob red wagon School dogThe output should be:
The Story of Bob
One day Bob decided to go to School to look for a red wagon they had lost. When Bob got to School the red wagon was not there. Bob was sad and went home. When Bob got home, they found that the red wagon was there so Bob was happy after all. Bob loaded his pet dog into the wagon and went back to the dog for fun.
You may make up or find your own story for the mad lib, or you might consider using one of these free very short stories..
Your mad lib must have at least three different words or phrases that you request from the user. For example if you use The Bat And The Weasels Fable you might allow the user to provide alternatives for bat, weasel, bird and mouse. This would allow the user to create the story of The Elephant and the Bacteria. Did you know Bacteria are enemies of an Emu?
Please keep your stories rated PG or lower.
I expect this program to be written at the CSCI 130 program 2 level. If you know javascript, or want to work ahead, please use an array, but this is by no means required.
If you are unfamiliar with Mad Libs, see the Wikipedia Page.
Please submit two linked html files.
The first provides
The second implements the game.
If you have created any javascript text files that are included in your program, please make sure that the file extension is not .js. Mail clients will reject tar files containing files with a .js extension. Please use the extension .prog.
Submit your tar file as an attachment to a message to dbennett@edinboro.edu. Please include your name, and the fact that this is homework 1 in the title of the message.