Create instructions for Marty to follow a path

Challenge learners to modify the responses to the color to something different than the Unplugged coding commands:
Another possible challenge would be to use logic blocks:
A further possible challenge would be to discover how many colors Marty detects and give each different color an action.
Have physical code cards available for learners to use, when building their scripts:
Have a print out of the basic if statement for the green color.
For learners who are challenged by estimation, encourage learners turn on Marty's Unplugged mode so that they can count the steps between the cards before assigning values to the movement blocks.
Look at some of the lessons that use loops and conditional statements:
Additionally, please consult the instructions for installing the color sensor
18 of 18 linked standards shown.
| Curriculum area | Linked standards |
|---|---|
| Digital Technologies, Design & technologies: Design & Technologies | |
| Digital Technologies, Design & technologies: Digital Technologies |
Select a code to read the full standard.
| Curriculum area | Linked standards |
|---|---|
| General standards |
Select a code to read the full standard.
| Curriculum area | Linked 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.
| Curriculum area | Linked standards |
|---|---|
| Computing, Design and Technology: Computing | |
| Computing, Design and Technology: Design and Technology |
Select a code to read the full standard.
| Curriculum area | Linked standards |
|---|---|
| International Society for Technology in Education (ISTE) |
Select a code to read the full standard.
| Curriculum area | Linked standards |
|---|---|
| Elementary Technology Applications: Grade 3 to Grade 5 |
Select a code to read the full standard.
In this lesson learners will extend their knowledge of if statements to create code that will mimic Marty's Screen-Free mode.
In order to work with this lesson, each Marty will need to have a color sensor installed. Details about the color sensor can be found by clicking on this link.
Experience using if statements, loops and the Controller
Writing instructions, Maths direction language
This is recommended as a floor activity as it will require a degree of movement, from Marty.
Show learners how to start Marty in Unplugged mode. This will allow learners to instruct Marty without making use of the app at all. Click here to see how screen-free coding works.
Have learners experiment with the color cards or with other colored paper to see what Marty can 'recognise'. Ask learners to tell you the different commands that Marty performs as a response to the colors and make a record of this for learners to see for the duration of the lesson - this could be done on a board in the classroom or in the workbook for each group.
Share with learners the objectives and success criteria for today's lesson.
Share with learners the video from the presentation or model a Marty with the code that is available below and in the Teacher's guide. If you choose to display with a physical Marty, ensure that learners hear you have turned on and turned off the Unplugged mode so they do not think you are cheating. Learners will see that the code is exactly the same as the screen-free color cards.
Ask questions about how Marty 'decides' to move as he does.
What do we need in code to have an action occur when something else happens, first?
It is hoped that learners will suggest an if statement, or a conditional statement if you have introduced that vocabulary.
If learners do not offer this, ask questions like, when do you go home? Answers might include,
Ask for other scenarios like this if you want to reinforce the need for 'if'.
Have learners remind you of the if statement - how it is composed - "If one thing happens, another thing will result."
Show the code block for the color sensor and show the result as Marty stands on different color cards. Show the structure of the if statement so learners can see what is needed for the if statement to be used effectively. Share the additional blocks that would be helpful to result in an action occurring depending on a color.

Share an example of Marty reacting to a color and performing an action. If modelling with your Marty, ensure that the robot is standing on the required color before running the program. If you change colors, nothing will happen; if you bring the initial color back, nothing will happen. Question what it is that stops Marty from moving again. Have them think together with their groups and use their discussion to inform their work, rather than answers in the whole group. The reason for nothing happening is because the program does not ask Marty to check again; for that, we would need a repeat block.
Task learners to create code for one color, including that when the color is removed and returned Marty will move again.
Once learners have discovered the necessity of the repeat lock, or other method for repeating the movement, have them expand their code to consider other colors and the necessary action. How can we ensure that different movements will happen when colors change but still check for all of the colors? Learners will need to have multiple if statements inside the loop forever block to accomplish this.
Walk around the room to discuss where groups are in their work. Ask questions like, how does Marty know what to do with the color? What if the color changes? Do you have a command to stop the code or will it run forever?
Bring learners back together to discuss the challenges they faced and overcame. Have groups model their creations and explain what is happening, when. Encourage other groups to ask questions to deepen their understanding of the processes.
Take time to have group code displayed to the class, encourage observational questions from peers.
Suggested questions you might ask:
Carry out any end of lesson routines.
Log off devices and clear everything away.