Extension Challenge

Challenge 1: Using lists in Scratch to create random stories.

A list is a type of variable that lets you store more than one piece of information inside. In this challenge, you can create a list of nouns, a list of verbs, a list of adjectives, and any other lists and then have your code pick one at random to complete your story.

Tips for doing this:

· In Variables you can make a list

· You can ask for a word to add to the list by using the ask block in Sensing and adding answer to your list

o When you want to use a random word in your story there are three things you must do:

o Create a variable to use in the story

o Use a random number block from Operators to get a word from a random place in your list

o Then set your story variable to be this random word

· Fill your lists when you click the green flag and tell your story when you hit space

· Can you hide your lists after you fill them?

Challenge 2: Code a mad lib using Python coding language.

You can write and execute python code using this free web-based editor, clicking <>Start Coding, and selecting python:

Tips for doing this:

· Use input to set the value of all of your variables – watch what type of information you’re gathering: string, integer, etc. This may affect how the story is shown

· Use the print command to show your story once you’ve gathered all your information

· Can you use arrays to create random stories as above?

Python Reference Documentation: https://www.w3schools.com/python/python_reference.asp

You can watch a basic tutorial here: https://www.mikedane.com/programming-languages/python/building-a-mad-libs-game/

Last updated