Skip to content
Learning Site
Home

About

  • About Robotical
  • Case Studies
  • Meet the Team
  • Blog
  • Contact Us

Our Products

  • Marty the Robot
  • Axiom
  • Cog

Teach

  • Lessons & Resources
  • Marty for Educators
  • Funding & Grants
  • Professional Development
  • Why Teach STEM?
  • Coding Environments
  • Student Led Learning

Let's Code

  • Marty the Robot
  • Code Online
  • Marty Apple App
  • Marty Android App
  • Update your Marty
  • Cog
  • Code Online
  • Cog iOS App
  • Cog Android App
  • Axiom
  • Axiom Science

Support

  • Marty Get Started
  • Cog Quick Start Guide
  • Axiom Science Quick Start Guide
  • Support & FAQs
  • Marty V2 User Guides
  • Marty V1 Resources
  • Request Support
  • Request Top-Up Training

Shop

  • Marty the Robot and Physical Computing
  • Class Packs
  • Add Ons & Extras
  • Account
  • Shipping, Returns & Cancellations
  • Distributors
HomeLessonsUnits of workCurriculum standardsTutorials

Information

  • Lessons & Resources
  • Knowledge Base & User Guides
  • About Us
  • Shipping, Returns & Cancellation
  • Privacy Policy
  • Learning site privacy
  • Terms of Service
  • Partner Hub

Support & Help

  • Support & Help Center
  • Getting Started with Marty V2
  • Getting Started with Marty V1

Learning, Resources & Guides

  • Marty V2 Lessons Site
  • Marty V1 Lessons Site

Contact Us in the UK

Stanhope House,12 Stanhope Place,Edinburgh,United Kingdom,EH12 5HH
(+44) 0131 564 0922
hello@robotical.io
Contact Us

Contact Us in the US

2810N Church St, PMB 61694,Wilmington,Delaware,USA19802-4447
(+1) 833 886 1661
hello@robotical.io
Contact Us

Why not join our mailing list?

For News, New Products and Special Offers

Join mailing list

Copyright 2016-2026 © Robotical Ltd

All lessons
Marty app
CurrentPrevious

1.06: What Happens If?

What are IF statements and why are they used?

1.06: What Happens If?
Estimated time
45 minutes
Difficulty
Intermediate
Products
Marty V2

On this page

  1. Lesson overview
  2. Objectives & resources
  3. Key vocabulary
  4. Lesson plan
  5. Extensions and challenges
  6. Additional reading
  7. Curriculum standards

Extensions and challenges

Extend:

There are two further maze options, one is easier and one is more challenging. In addition, there are samples with no numbers on them. Learners who complete one maze could be given the second maze as a blank maze where they need to find and label places in the maze that require a choice of direction.

Support:

There are two further maze options, one is a standard maze, it is less complex, with fewer IF statements to consider.

Remind learners to rotate the maze or draw arrows as they approach numbers so that their point of view informs which direction they need to take.

Additional reading

Marty the Robot Educator Guide

  • Educator FAQ

Curriculum standards

17
Choose your curriculum to see the relevant standards.

17 of 17 linked standards shown.

Australian CurriculumAustralia3
Curriculum areaLinked standards
Digital Technologies, Design & technologies: Design & Technologies
Digital Technologies, Design & technologies: Digital Technologies

Select a code to read the full standard.

Digital Technologies, Design & technologies: Design & Technologies

  • ACTDEP015Generate, develop, and communicate design ideas and decisions using appropriate technical terms and graphical representation techniques

Digital Technologies, Design & technologies: Digital Technologies

  • ACTDIP010Define simple problems, and describe and follow a sequence of steps and decisions (algorithms) needed to solve them
  • ACTDIP011Implement simple digital solutions as visual programs with algorithms involving branching (decisions) and user input
CSTA Education StandardsUSA2
Curriculum areaLinked standards
General standards

Select a code to read the full standard.

  • 1B-CS-02Model how computer hardware and software work together as a system to accomplish tasks.
  • 1B-AP-10Create programs that include sequences, events, loops, and conditionals.
Curriculum for ExcellenceScotland7
Curriculum areaLinked standards
Health and Wellbeing: Mental, Emotional, Social and Physical Wellbeing
Literacy & English: Listening and Talking
Literacy & English: Writing
Technologies: Computing Science

Select a code to read the full standard.

Health and Wellbeing: Mental, Emotional, Social and Physical Wellbeing

  • HWB 0-14a / HWB 1-14a / HWB 2-14a / HWB 3-14a / HWB 4-14aSocial wellbeing

Literacy & English: Listening and Talking

  • LIT 1-04aFinding and using information
  • LIT 1-09aCreating texts

Literacy & English: Writing

  • LIT 1-23aTools for writing
  • LIT 1-28a / LIT 1-29aCreating texts

Technologies: Computing Science

  • TCH 1-13aUnderstanding the world through computational thinking
  • TCH 1-14bUnderstanding and analysing computing technology
England's National CurriculumEngland1
Curriculum areaLinked standards
Computing, Design and Technology: Computing

Select a code to read the full standard.

Computing, Design and Technology: Computing

  • ✔️Understand what algorithms are; how they are implemented as programs on digital devices; and that programs execute by following precise and unambiguous instructions
ISTEUSA2
Curriculum areaLinked standards
International Society for Technology in Education (ISTE)

Select a code to read the full standard.

International Society for Technology in Education (ISTE)

  • 1aStudents articulate and set personal learning goals, develop strategies leveraging technology to achieve them and reflect on the learning process itself to improve learning outcomes.
  • 5dStudents understand how automation works and use algorithmic thinking to develop a sequence of steps to create and test automated solutions.
TEKSUSA2
Curriculum areaLinked standards
Elementary Technology Applications: Grade 3 to Grade 5

Select a code to read the full standard.

Elementary Technology Applications: Grade 3 to Grade 5

  • 4.BCritical thinking, problem solving, and decision making. The student applies critical-thinking skills to solve problems, guide research, and evaluate projects using digital tools and resources. The student is expected to: (B) collect, analyze, and represent data to solve problems using tools such as word processing, databases, spreadsheets, graphic organizers, charts, multimedia, simulations, models, and programming languages;
  • 6.ATechnology operations and concepts. The student demonstrates knowledge and appropriate use of technology systems, concepts, and operations. The student is expected to: demonstrate an understanding of technology concepts, including terminology for the use of operating systems, network systems, virtual systems, and learning systems appropriate for Grades 3-5 learning;

Resources

Learner resources

  • Hard maze - blankFile links loading
  • Hard mazeFile links loading
  • Standard mazeFile links loading
  • Standard maze - blankFile links loading
  • Workbook for What Happens If?File links loading

Educator resources

  • Teacher GuideFile links loading
  • Story textFile links loading
  • Teaching Maze - NumberedFile links loading
  • Teaching Maze - BlankFile links loading
  • Presentation for What Happens IfFile links loading

Lesson overview

In this lesson, students will continue to develop their understanding and programming skills by looking at a concept called IF statements. Students will be asked to relate IF statements to situations in real life before using them to describe progress in a maze.

Prerequisite knowledge

Writing instructions, work with loops

Learning objectives

I can explain what I do when I have a choice.

I can decide what a robot should do when there is a choice.

Resources and equipment

  • Marty the Robot
  • Marty Workbook
  • Tablets with the Marty the Robot app

Key vocabulary

  • If
  • Then
  • True
  • False
  • Choice

Lesson plan

Warm-up:

Share with learners the lesson objectives and success criteria from the presentation. There is a story text that is available to support the idea of choices, and how we and Marty look differently at the idea of choice. The story text is presented with the PowerPoint so that learners can see video and graphics of Marty performing a variety of the tasks but you can choose if you want to just read the text, read the text with the presentation or read the text with a physical Marty performing actions.

Get Learning:

Following the story text, tell learners that we are going to sing a song about choices - If You're Happy and you Know it - but before we start singing we need to think about some different feeling words we could use and some actions that can go with them. Instead of starting each verse with 'If you're happy and you know it,' order the feeling words to be used and attach an action to each feeling word.

Have learners work in groups to rewrite the song with different feelings and potential actions and decide, as a class, which ones you want to sing.

Sing the first verse, which may actually be if you're happy and you know it, then pause the track after that verse and ask the learners, "How many of you are happy (or the appropriate feeling word), right now?" If there are some who don't say that they are, ask them why they performed the action. They may answer, "Because it is in the song; it tells us to; that's what the words say" or something like that. Tell learners that robots are different. They would only do the action if the feeling were true. If the robot wasn't (feeling word), it wouldn't (action word).

Let's try the song again with the other feeling words but this time let's be robots. Let's only do the action if we feel that way and not if we don't. This will support the idea that computers, and robots, only carry out instructions that involve conditions that are true.

The video clip below will play the backing track, there is no need to show the video. It is not essential to play the backing track if you are happy singing without music or you have your own instrument.

Ask learners what they do when they are given a choice: you are leaving and you have two jackets. One of the jackets will keep you warm and one of the jackets will keep you dry. Which jacket would you choose to wear? Learners should suggest that it depends on the weather: if it is wet, I will wear the one that keeps me dry; if it is cold I will wear the one that keeps me warm.

Highlight the word IF. Tell learners that, for robots and computers, this word is something that tells us something may happen after a choice is made. The difference is, we can easily figure out what will happen IF we do something, but we need to program machines, and robots, with what will happen when they have an IF statement.

Time for Practice

Ask learners for some examples where they don’t even need to think about the consequences, negative or positive, of an action, so they don’t take any time whatsoever choosing what to do:

  • If I brush my teeth
  • If I forget to tie my shoelace
  • If I practice my spelling words
  • If I eat my vegetables
  • there are more in the teacher guide

Have learners think about what a machine would have to be told, through the if statement, when faced with even a simple choice. Robots need to be told what happens after IF. They need to be told THEN.

Share with learners the maze that can be used to decide on the result of a condition, this could be printed out or shown from the presentation. Walkthrough the maze for each number:

  • If I see a 1, turn left;
  • If I see a 2, go straight, etc

As you approach each of the numbers, stop at it and draw an arrow pointing at it to support learners in seeing which direction they need to moving, going forward. This is important in terms of directional language: for 1, you don't go 'up', you turn left; the same is true for 2, you turn 'left' rather than going 'down'; for 3, you go straight; 4 is not necessary for the completion of the maze but is worth exploring because of the direction you face when you approach it. A further support in identifying the correct direction would be to have learners rotate the maze so that the direction of travel is always the same as their point of view when looking at the maze.

Here is a video of Marty walking a real-life creation of the start of the maze. This is in the presentation.

Resources are included so that learners can complete their own maze, with the emphasis being on the action after a condition is met. Have learners write if statements at each of the numbers. If a learner is only trying to reach the exit, they don't need to write a statement for each of the numerals but need to include the direction that they take following the numbers they pass on the way to the exit.

  • If I see the number 1 then I need to go straight, turn left / right
  • If I see the number 2...

Each maze resource has its solution in the teacher guide.

Cool Down:

Bring learners back together to discuss the challenges they faced and overcame. Have groups share their instructions for getting through the maze, question, and celebrate different ideas that lead to different places.

Suggested questions you might ask:

  • Why are the actions necessary after a choice, for computers and robots?
  • Where else might if statements happen in your daily life?

Carry out any end of lesson routines.

Log off devices and clear everything away.

Watch on YouTube
Watch on YouTube