(Francais) F4: Variables - Complex Variables
Level F, Lesson 4: Students understand how to use and manipulate variables. They will use Blockly preset programs and Challenge Cards to practice their new skills. Objectives Students will: Define a v

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 changed the (random variable amounts) because . . .").
- Share any obstacles and difficulties they overcame during the activity (e.g., "At first, we didn't know how to change the change the variable amount, but then we tapped on the variable block and figured out what to do.")
- 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 your conditional block)?"
- "I like how you (added lights, sounds, and animations)."
- "What if you (added an event handler)?"
Follow-Up Questions/Discussion
- How did the variable block help you with your program? (Sample response: "The variable is set to a random number and continues to change until the Top Button is pressed.")
- How was the variable used differently in this lesson than in our last lesson? ("Sample response: The variable changed to a random number in this program. In the last program, it was set to zero.")
Assessment
- Use our Evaluation Rubric to review students' work and presentations.
- [Optional] Share your students' work with the world using @logicsacademy and #dashanddot!
Educational Standards
CSTA
ISTE
NGSS
Common Core
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!
Hot Potato Extension
- Have students use the Wonder Journal: Dot Planning or General Planning worksheet to design ways to add to or alter the Tickle Tackle preset program. They can:
- Change the conditional block
- Add lights and sounds.
- Change how much the variable increases or decreases.
- Change the cue.
- 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 Dot 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.1: Magic Dot Ball
- F 3.2: Duck, Dot, Goose!
- F 3.3: Win, Lose, or Dot
- For each challenge, encourage students to:
- Use the Wonder Journal: Dot Planning 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.
- After they finish each challenge, have students:
- Complete a Wonder Journal: Reflection worksheet.
- Take a screenshot of their Blockly code.
- Take a video of Dot while the code is running.
- Update their Challenge Card Checklists.
Guided Practice
Activity: Hot Potato
- 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 Hot Potato preset program. Then tap “create.”

- Ask the students to look at the program and predict what they think will happen when it is run.
- Then, have students play Hot Potato by passing Dot around. The person holding Dot when Dot beeps is out! Keep playing until there is only one person left.
- Have students look at the program while it’s running. Then ask, “How is the variable changing while we play Hot Potato?”
- Sample response: “This program chooses a random number (between 2 and 10) and stores that number as a variable. Then the variable keeps decreasing until it becomes 0. When the variable is 0, then Dot beeps and ends the game!”)
- Ask, “How do you set a variable to a random number?”
- Sample response: “To set a variable to a random number, tap on the Set Variable block. Then tap on the picture of the dice and use the + and - signs to move the numbers up and down.”)
- Tap on the change variable block and say, “Now let’s look at the Change Variable block. Discuss with a partner how you think this block works.”
- Sample response: ”This block works by increasing or decreasing the number that the variable has stored. We can use addition, subtraction, multiplication, or division.”
Quick Check
- How do you increase your variable by 1? (Sample response: “Use a Change Variable block. Choose the + sign and then the number 1.”)
- How do you set your variable to a random number? (Sample response: “Use a Set Variable block and tap on the dice. Then choose a range for your random number such as 1-5.”)
Instruction
Introduction
- Ask, “How did you use variables in the last lesson?” (Sample response: “The variable was used to keep track of the number of times Dot’s Top Button was pressed.”)
- Ask, “Have you ever played the game Hot Potato?” In Hot Potato, you pass a potato (or ball) around a circle. During the game, music is played. When the music stops, the person holding the potato is out.”
- Say, “Today, we are going to play Hot Potato with Dot. Dot will be the potato.”
Quick Check
- What are variables? (Sample response: “Variables are containers that hold information that can be changed.”)
- How do you use a Repeat Until block? (Sample response: “The repeat until block is used when you want a behavior to continue until something happens.”)
Review
Variables Review
Briefly review how variables were used in the previous lesson by saying,“In our previous lesson we used variables to make Dash feel Dizzy. How were variables used in that program?”
- Sample response: “The variable kept track of how many times Dash’s Top Button was pressed. Then, the program used an if statement to use the information stored in the variable to tell Dash to stop spinning and ask for help.”
Blockly In-App Puzzle [Optional]
- Have students complete the Ticking Time Bomb puzzle. You can find walkthroughs, solutions, and extensions for the puzzle.
- Have students update their Blockly Puzzle Checklists.
- Note: If previous puzzles are locked, show students how to quickly unlock them using this strategy: https://help.makewonder.com/customer/en/portal/articles/2318965-how-can-i-reset-challenges-unlock-free-play-or-unlock-wonder-cloud-?b_id=14312
Code.Org Connections [Optional]
Review Code.org’s lesson focusing on variables: https://studio.code.org/s/coursef-draft/stage/6/puzzle/10?solution=true
- “How were variables used in these puzzles?” (Sample response: “The variables held a specific measurement or number representing the number of sides of a polygon. Using a variable in this way allowed us to draw shapes.”)
Before the Lesson
Prior Experience
It is recommended that students complete:
- Levels A-E Lessons: All
- Level F: Lessons 1-3
- [Optional] Level A-E Challenge Cards: All
- [Optional] Level F Challenge Cards: F 1.1-2.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.
