Learn to create your own silly stories with coding.
Our scientists back on Earth need to run some simulations! In our take on the classic Mad Libs game, students will fill in the spaces of storylines they create themselves. Students will tap into their creativity to create exciting and random silly stories.
Students will use the Raspberry Pi Pico microcontroller to fill in the blanks of storylines they create in our take on the classic game Mad Libs.
Students will understand how to create a prompt to input a value that is stored as a variable.
I WILL BE ABLE TO...
Use code to fill in the spaces of storylines in a fun game of Madlibs
Use variables to store inputs that can then be displayed in the console
Learning Activities
ELA Extension: Silly Story Generator
Pair students up or allow them to work independently based on grade level and language ability.
Students will begin by generating a randomized silly story prompt using the Piper Code project (e.g., “Piperbot took a banana to space because it needed to power the sun!”). This story starter will serve as the launchpad for a creative writing piece, comic strip, or dramatic skit.
Next, students will brainstorm using a graphic organizer to outline key story elements: characters, setting, problem, and solution.
Students will then write a 1-, 3-, or 5-paragraph story based on grade level expectations. Stories must include:
A clear beginning, middle, and end
Dialogue between characters
A cause-and-effect structure (logical or completely silly)
After writing, students will trade drafts with a partner for peer editing and revision. Partners will give feedback on structure, vocabulary use, and creativity.
Finally, students will present their final story by reading it aloud, performing it as a short skit, or creating a comic strip version.
Bonus vocabulary words to include: input, random, output, sequence, condition, story
EXTENSION: Display completed stories on a classroom “Silly Story Wall” or post them in a digital gallery with accompanying illustrations or code screenshots.
ELD Extension: Silly Story Swap
Pair students up so that each English Learner (EL) is working with a fluent English speaker or a higher-level EL.
Each student will begin by generating a silly story starter using the Piper Code project or teacher-provided prompt. Students will then draw a scene that represents their silly story idea.
Support students with a word bank that includes: robot, banana, fly, space, friend, chicken, dance, because.
In mixed-language pairs, students will take turns explaining their drawings using structured sentence frames such as:
"My robot is ___ because ___."
"In my story, the ___ went to ___ to find a ___."
After sharing, partners will swap drawings and create a short ending for their partner’s story. Students will then share the new version aloud, either in small groups or with the whole class.
As a class, reflect on the stories using emotion and description. Discuss:
Which stories made you laugh the most?
What made the story funny, silly, or surprising?
Encourage use of adjectives and feelings such as: funny, exciting, surprising, weird, creative.
Math Extension: Silly Story Generator
Pair students together or allow them to work independently based on grade level and math readiness.
Students will begin by running the Silly Story Generator code multiple times, or use a die-based version with randomized story parts (character, action, setting, reason).
Each student will complete at least five story generations and record the key variables from each outcome. Students should log: Character, Action, Setting, and Reason.
Using the collected data, students will create a frequency chart or bar graph to represent how often each element appeared.
Example questions to explore:
“Which character showed up the most?”
“How many times did the banana go to space?”
“What’s the probability of Piperbot dancing with a chicken?”
Students will share their findings in small groups or as a class and analyze the randomness of the generator.
Use discussion prompts such as:
“Is the generator fair?”
“What patterns or surprises did you notice?”
“If we ran it 100 times, what outcomes might we expect?”
Encourage students to reflect on how randomness and repetition can still lead to recognizable patterns over time.
Bonus vocabulary words to include: random, variable, pattern, frequency, probability, outcome, data.
Have an different version? Look for more information on the Support Page.
Troubleshooting Tips
Are the prompts missing from the console when you hit START?
Ensure that the ask block is in place, as this block requires input from the user in the console.
What is a variable?
A variable is a value that can change depending on conditions or information passed to the program.
Our customer support specialists are on hand to ensure your implementation of Piper runs seamlessly. View Support Docs or Contact Support
EXPANDED RESOURCES
Term Glossary
Circuit A conductive path for the flow of current or electricity.
Power The current or flow of electric charge and voltage.
Microcontroller An integrated circuit containing a microprocessor with memory and associated circuits.
Variables A value that can change depending on conditions or information passed to the program. A storage location with a symbolic name used to keep track of a value that can change while a program is running (similar concept to using X and Y in an algebraic equation). Variables are not only numbers; they can also hold text, including whole sentences (strings) or logical values (true or false).
Input Device A hardware device that sends data to a computer, allowing interaction and control.
Output Device A piece of hardware that converts information into a form humans can sense and understand.