← Back to Library
Lesson PlanFreeFR
(Francais) E4: Functions - Part 1
Level E, Lesson 4: Students will review their previous lesson on Function blocks and explore using Functions in computer programming. They will use Blockly preset programs and Challenge Cards to pract

Guided Practice
Activity: Yes No Yes
- 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 Yes No Yes 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 to see if the students' predictions were correct.
- Ask, "How could you change Dash's movements inside the functions?"
- Sample response: "You can add more drive blocks or change the angles of the look blocks."
- Have student volunteers identify where the Call Function blocks are in the program. Then show them where to find the Call Function block in the Start menu.
- Say, "Could you run this program using a Repeat block instead of a function? Why or why not?"
- Sample response: "You could not use a Repeat block since the functions do not repeat consecutively. Repeat blocks can only be used in bits of code that repeat over and over in the same place in the program."
- Say, "In Yes No Yes, we used functions to make Dash say 'yes' and 'no.' Think of how you could change the functions for the program so that they make Dash demonstrate two opposite behaviors."
Quick Check
- How were functions used in this program?
- Could you have written this program without functions? (Sample response: "Yes, you could have written this program without functions, but the program would have been much longer.")
Review
Functions Review
- Ask, "What is a function?"
- Sample response: "A function is a piece of code that can be called over and over."
- Ask, "How did you use functions in the last lesson?"
- Sample response: "We used functions to create a song/chant."
- Ask, "Why was using functions important in that activity?"
- Sample response: "Functions enabled us to write a chant/song without having to rewrite the chorus each time it was used."
Code.Org Connections [Optional]
- Show Code.org's video about functions: https://studio.code.org/s/course3/stage/9/puzzle/1
- After watching the video, ask, "What songs can you think of that have choruses?"
- Sample response: "Jingle Bells" or "Hokey Pokey"
Educational Standards
CSTA
ISTE
NGSS
Common Core
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 (another function) to the program because . . .," or "We changed actions in the function blocks here because . . .").
- Share any obstacles and difficulties they overcame during the activity (e.g., "At first, we didn't know how to call a function, but then we found the Call Function block in the Start menu").
- 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 (program Dash to move like that)?"
- "I like how you (added another function)."
- "What if you (changed the order of the Call Function blocks)?"
Follow-Up Questions/Discussion
- How did the function block help you with your program? (Sample response: "The function block helped me repeat non-consecutive sequences of code.")
- Could you have written the same program using loops? (Sample response: "No, because loops repeat consecutive lines of code.")
Assessment
- Use our Evaluation Rubric to review students' work and presentations.
- [Optional] Share your students' work with the world using @logicsacademy and #dashanddot!
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!
Yes No Yes Extension
- Have students use the Wonder Journal: Dash Planning or General Planning worksheet to design ways to add to or alter the Yes No Yes preset program. They can:
- Change the name of the functions.
- Change/add lights, movements, and sounds to each function.
- Add a loop.
- Add conditionals by using If or If/Else blocks.
- Change the order that the functions are called.
- 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
- 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:
- E 3.1: Dance Rehearsal
- E 3.2: Fancy Wheelwork
- E 3.3: Dance Off!
- For each challenge, encourage students to:
- Use the Wonder Journal: Dash 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 Dash while the code is running.
- Update their Challenge Card Checklists.
Instruction
Introduction
- Say, "We learned how to use functions in songwriting. Today, we will learn how to use functions in a computer program by studying a Blockly preset program."
- Review real-life examples where you would use functions, such as:
- singing a song chorus
- doing a routine event, like brushing your teeth
- Discuss how students might use functions in their code: "We can use functions to repeat parts of our code over and over again. Unlike loops, we can repeat the function's code in multiple places of our program."
Quick Check
- How is using functions in a program similar to the chorus of a song? (Sample response: "The chorus of a song repeats multiple times throughout the song. The function in a code can repeat multiple times throughout the program. There are bits of code in between each instance of a function in a program, just like there is other music in between each instance of a chorus in a song.")
- How do you use functions in your life? (Sample response: "Making different types of sandwiches for a group of friends requires repeating some steps (like a function) while still performing a few different steps for each sandwich, such as using different meats and cheeses.")
Before the Lesson
Prior Experience
It is recommended that students complete:
- Level A-D Lessons: All
- Level E: Lesson 1-3
- [Optional] Level A-D Challenge Cards: All
- [Optional] Level E Challenge Cards: E 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.
