Unit 1, Module 3 : Interactive Mad Libs
Daily Summary
In our last session you learned how to use the ask block with variables to create a version of "Mary Had a Little Lamb" that asked questions than then used the results to tell a slightly different story. Today you will work with a small team to create a Mad Lib.
I bet most of you have played with Mad Libs before. You ask a player to provide you with several parts of speech (noun, verb, adjective, etc.) and then their responses are placed into a partially existing story - normally with wacky or crazy results. For examples you can check out the official Mad Libs website at (www.madlibs.com).
But for this assignment I would like you to create an interactive story/mad lib based on a popular nursery rhyme.
Hey Diddle Diddle. The (animal1) and the fiddle. The (animal2) (past-tense verb 1) over the moon. The (adjective) (animal3) (past-tense verb 2) to see such a sight. And the (noun) ran away with the spoon. |
Activity 1
Last session we learned how to use Ask, variable blocks, and Join to make interactive programs. In this activity we will review that process.
- Consider the following short Scratch program. What will it do when the program is run?
- In a new, empty Scratch program copy down the code above.
- Run it. Did it do what you predicted? If not, why not?
Activity 2
Now suppose we want to make a full blown Mad Lib of Hey Diddle Diddle:
- How many questions will you need to ask the human user to complete this Mad Lib?
- How many variables will you need to store their responses? What are good names for each of those variables?
- In your Scratch program go to the variables tab and add the needed variables.
- In your Scratch program add the required questions to the program BEFORE the wait 1 second block.
- After EACH question add the code necessary to store the user's answer.
- Finally, at the end of the current program add a series of Say blocks with the appropriate Join blocks and variable pegs so that the Mad Lib is told.
- What was the hardest part of this process?
- What did you learn in this practice that might help you with your upcoming homework assignment (where you will use ask/say blocks in a similar way)?
Call me over to check out your program when you get to this point!
Activity 3
Mary had a Little Lamb was made much more interesting by adding some visual elements to the story that changed based on the user's choice(s). Let's do that here too.
- Add the Guitar sprite to your program. We will pretend this is a fiddle.
- Add the Bat sprite to your program.
- Between the "say Let's tell a story!" and the "say Hey diddle diddle." blocks add a broadcast that says "broadcast fiddle"
- Go to the scripts for the Guitar and the Bat and add show/hide commands:
- Go to the costumes tab for the Bat sprite and add two additional costumes for this sprite – perhaps a dog, and a monkey [but you have permission to make this even more customized and pick any three costumes you like].
- Change the very first ask block so that instead of saying "Please give me the name of an animal" it says "Please pick between bat, dog, and monkey" [Note, if you used different sprites in step 2 adjust this to match your decisions].
- Go to the code for the bat and add some code to the "When I receive fiddle" block. This code should use the value of the variable set in the previous step and change the costume of the bat sprite to the appropriate animal/thing.
- What was the hardest part of this process?
- What did you learn in this practice that might help you with your upcoming homework assignment (where you will use ask/say blocks in a similar way)?
- Find some other element(s) of the story you would like to customize in a similar manner. Call me over to check it out when you have it working!