1 of 11

Plan, Debug, and Build

Act 3: Unit 3.3

variable

2 of 11

UNIT 3.3 Variables

​

​

​

​

WB Page

​

Madlibs Project Planning Guide

Unit 3.3

Your tasks:

  1. Write one or two sentences for your sprite to say. Use at least TWO variables that the user will provide information for. Put those variables in brackets [ ].

​

​

​

​

  • List the variables you will create.

​

​

​

​

​

​

​

Examples:

number

-ing verb

food

animal

  1. ___________________
  2. ___________________
  3. ___________________
  4. ___________________

WB Page

44

3 of 11

Here is the text that the example project used:

​

​

​

​

​

​

​

The highlighted words are the variables that the user provided information for.

​

UNIT 3.3 Variables

​

​

​

​

WB Page

​

WB Page

44

Madlibs Project Planning Guide

Unit 3.3

When you are [number] years old you will love [-ing verb] and eating [food] . You will love your pet [animal] .

4 of 11

UNIT 3.3 Variables

​

​

​

​

WB Page

​

WB Page

43

Madlibs Project Planning Guide

Unit 3.3

WB Page

44

5 of 11

WB Page

​

WB Page

45

DEBUGGING

​

When I click the green flag, the name variable has a name in it. It should be blank or 0. How can I fix this?

​

When I enter a name into the program, it doesn’t display the name in the sentence. How can I fix this?

​

​

​

​

​

Madlibs Debugging Challenge

Unit 3.3

6 of 11

Madlibs Debugging Fix

Unit 3.3

7 of 11

Madlibs Build Guide

Unit 3.3

  1. Select or design a backdrop and select 1 sprite from the Scratch library to add to your project.

​

​

  • Click on the Variables category and create the variables using the names you created in your planning guide.

​

  • Create a green flag clicked script that sets the starting variable values.
  • Create another green flag clicked script, that starts with a “wait 1 second” block that asks the user to enter the variable values. At the end of this script, include a broadcast block to send a message to the ‘when I receive’ event block in step 5.

​

  • Create another script starting with a ‘when I receive’ event that uses a say block. Put join blocks in the say block. Put text and variable blocks in the join blocks to display your Madlib.

​

**You can include “wait” blocks in between your “ask” and “set” blocks to allow enough time to read the questions!

​

​

Select a backdrop and a sprite

Create scripts for the variable values

Create the Variables

Create a script to display your Madlib

Create a Madlib project using Variables!

SHARE, REMIX and SAVE to the “Student Madlibs Projects” studio

WB Page

45

8 of 11

Madlibs Build Guide

Unit 3.3

If you finish early…

BUILD YOUR SCRATCH SKILLS

Create and Use a Variable bit.ly/createvariable

Add and Edit a backdrop

bit.ly/changebackdrop

Follow these video instructions on how to:

WB Page

45

9 of 11

UNIT 3.3 Variables

​

​

​

​

Madlibs Project Checklist

Unit 3.3

DESIGN

⃞ I chose 1 sprite and a backdrop from the Scratch library.

VARIABLES: CREATE

​

⃞ I created 2 variables for my questions.

VARIABLES:

STARTING VALUES

⃞ I used a “green flag clicked” event that:

⃞ sets the starting values for my variables to zero

VARIABLES:

SCRIPT

⃞ I used a second “green flag clicked” event for all my ask statements:

⃞ the ask statements for all my sentences

​

⃞ I used “set” blocks to transfer the user answer to my variables

⃞ I used “say” blocks with join blocks to display my sentences using text and variables

​

WB Page

46

10 of 11

Checking Your Madlibs Project

Make sure you have done everything in your Madlibs project with this auto checking system! bit.ly/act3ProjectChecker

2. Go to bit.ly/act3ProjectChecker and enter the URL of your project and press “Go!”

  1. Copy the URL of your Madlibs project.

11 of 11

Make time to try out your classmates’ programs!