(Francais) F5: Variables - Multiple Variables
Level F, Lesson 5: Students understand how to use and manipulate many variables within the same program. They will use Blockly preset programs and Challenge Cards to practice their new skills. Objecti

Educational Standards
CSTA
ISTE
NGSS
Common Core
Before the Lesson
Prior Experience
It is recommended that students complete:
- Levels A-E Lessons: All
- Level F: Lessons 1-4
- [Optional] Level A-E Challenge Cards: All
- [Optional] Level F Challenge Cards: F 1.1-3.3
You can purchase our Learn to Code Challenge Card sets and Curriculum Guide here: https://store.makewonder.com/#/education
Preparation
- Fully charge the tablets and robots.
- Install the Wonder Workshop Blockly app on each tablet.
Review
Variables Review
Briefly review how students used variables to play Hot Potato with Dot during the previous lesson by asking:
- “How were variables used in that program?” (Sample response: “The random variable chosen was decreased until the variable was less than zero. At that time, Dot played a noise, indicating the game was over.”)
Code.Org Connections [Optional]
Complete Code.org’s lesson focusing on variables: https://studio.code.org/s/coursef-draft/stage/6/puzzle/1?solution=true&viewAs=Student Then ask:
- “How were variables used in these puzzles?” (Sample Response: “The variables held a specific measurement or number representing angles or distances. Using a variable in this way allowed us to draw shapes.”)
- “How were variables used differently here than in the set of puzzles in the previous lesson?” (Sample response: “These puzzles included more than one variable.”)
Instruction
Introduction
- Say, “Our past programs that contained variables have used only one variable. The program that we are working with today uses four variables.”
- Say, “Our variable in past programs was always named orange. Today, we will use not only the orange variable, but also the banana, cherry, and watermelon variables. Because of this, our programs will be able to store and manipulate four different numbers.”
Quick Check
- What are variables? (Possible response: “Variables are like containers that hold information that can be changed.”)
- What are the different variables that we can use in Blockly? (Sample response: “Orange, banana, watermelon, cherry.”)
Guided Practice
Activity: Dash the Snake
- Project your tablet screen, open the Blockly app, and go to the menu at the top left of the screen.
- Go to the Create New Project menu and select the Dash the Snake preset program. Then tap “create.”

- Ask the students to look at the program and predict what they think will happen when it is run.
- Run the program and point to the top left of the screen. Have students pay attention to how each variable changes value. Encourage them to make observations:
- When the orange variable increases in value, the banana variable decreases in value.
- The watermelon and cherry variables are either 10 or 0 and nothing in between.
- Dash turns left and right, in a snake pattern!
- Scroll down to the bottom of the code and point at the Do Variable block. Say, “This block is setting Dash’s wheel speeds to 2 variable values: orange and banana. That’s how Dash moves forward left and right like a snake.”
- Tap the Do Variable block and say, “Let’s see what else we can do with this block!” Then tap “Turn” and change the block to read “Turn Orange degrees.” Ask the class, “What do you think will happen when we run the program now?
- Sample response: “Dash keeps turning to the right.”
- Ask, “What behaviors could Dash do other than spin?” Then have student volunteers try changing the Do Variableblock and the variable values.
Quick Check
- How can you keep track of how the variables change throughout the program? (Sample response: “The variables show on the top, left-hand portion of your screen.”)
- How do you program Dash to move or turn based on the value of a variable? (Sample response: “Use a Do Variableblock. You can have Dash drive forward or change wheel speed based on the the value of different variables.”)
Independent Practice
Instructions
Have students work on the following activities in small groups (ideally 2-3 students per robot).
Encourage students to share tablet and robot time. Have them establish and rotate through roles such as:
- Lead Programmer: Holds the tablet and manipulates the code.
- Robot Wrangler: Retrieves and resets the robot after every program attempt.
- Documentarian: Records group results, thoughts, and progress. Illustrates group designs and ideas.
When students work together while coding, they're able to help each other identify mistakes and develop creative solutions!
Dash the Snake Extension
- Have students use the Wonder Journal: Dash Planning or General Planning worksheet to design ways to add to or alter the Dash the Snake preset program. They can:
- Change the conditional block.
- Add lights and sounds.
- Change how much the variable increases or decreases.
- Change the cue.
2. After they finish revising the program, have students:
- Complete a Wonder Journal: Reflection worksheet.
- Take a screenshot of their Blockly code.
- Take a video of Dash while the code is running.
Challenge Cards [Optional]
- You can purchase our Learn to Code Challenge Card sets and Curriculum Guide here: https://logicsacademy.com/store/
- Have students complete the following Challenge Cards:
- F 3.4: Lucky 7’s
- F 3.5: 13 = Yuck!
- F 3.6: Black Cats!
- For each challenge, encourage students to:
- Use the Wonder Journal: Dash Planning, Dot Planning and/or General Planning worksheets to discuss how they can complete the challenge.
- Review the Troubleshooting and Problem Solving & Debugging worksheet if they run into any problems with their code.
- Use the Wonder Journal: Dash Planning, Dot Planning and/or General Planning worksheets to discuss how they can complete the challenge.
- After they finish each challenge, have students:
- Complete a Wonder Journal: Reflection worksheet.
- Take a screenshot of their Blockly code.
- Take a video of Dash and/or Dot while the code is running.
- Update their Challenge Card Checklists.
Wrap Up
Student Presentations
- Have student groups take turns sharing one of their programs with the class. Encourage them to:
- Explain their design thinking (e.g., "We wanted to add (a different Do block) because . . .")
- Share any obstacles and difficulties they overcame during the activity (e.g., "At first we had a hard time keeping track of what was happening to the variables as the program was run, but then we watched the tablet screen as we ran the program several times instead of watching Dash").
- Explain their design thinking (e.g., "We wanted to add (a different Do block) because . . .")
- Encourage students to ask each other how they accomplished different objectives and give each other feedback on their programs. Possible questions/feedback includes:
- "How did you (change the Do block)?"
- "I like how you (added lights, sounds, and animations)."
- "What if you (added another variable)?"
Follow-Up Questions/Discussion
- In this program, Dash acted like a snake. Using this program as a guide, what other animals could you program Dash to act like? (Sample response: “I could program Dash to act like an owl by programming the Do block to make Dash look left and right.”)
- What is another way you could write a program using variables? (Sample response: I could write a program to have Dot keep score during a game.”)
Assessment
- Use our Evaluation Rubric to review students' work and presentations.
- [Optional] Share your students' work with the world using @logicsacademy and #dashanddot!
