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

2.02: Exploring Parameters and Arguments

Learn how to modify Marty's behaviour based on the values passed to functions

2.02: Exploring Parameters and Arguments
Estimated time
90 minutes
Difficulty
Beginner
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

Challenge learners to go beyond two shapes.

Challenge learners to create irregular shapes. They have the number of degrees per shape and have practised finding the supplementary angle Marty will need to correctly turn at a vertex. This extension activity will reinforce: the number of degrees in each shape, through addition, use of a compass to draw the correct angle at each vertex, and push their ability to improve code with multiple iterations; this will likely take a bit of time.

Support

Definitions about angles should be made available, particularly supplementary and the number of degrees for each shape. Individual copies of each shape are in a presentation, in the resources section. This could be printed out to support learners or displayed on the board as a reference if learners are drawing and measuring the shapes for Marty to walk.

Additional reading

  • Educator’s Guide

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

  • ACTDEP025Generate, develop and communicate design ideas and processes for audiences using appropriate technical terms and graphical representation techniques

Digital Technologies, Design & technologies: Digital Technologies

  • ACTDIP019Design, modify and follow simple algorithms involving sequences of steps, branching, and iteration (repetition)
  • ACTDIP022Plan, create and communicate ideas and information, including collaboratively online, applying agreed ethical, social and technical protocols
CSTA Education StandardsUSA2
Curriculum areaLinked standards
General standards

Select a code to read the full standard.

  • 1B-AP-09Create programs that use variables to store and modify data.
  • 1B-AP-15Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended.
Curriculum for ExcellenceScotland6
Curriculum areaLinked standards
Health and Wellbeing: Mental, Emotional, Social and Physical Wellbeing
Literacy & English: Listening and Talking
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 2-02aTools for listening and talking
  • LIT 2-05aFinding and using information
  • LIT 2-07aUnderstanding, analysing and evaluating

Technologies: Computing Science

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

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

Computing, Design and Technology: Design and Technology

  • ✔️Design purposeful, functional, appealing products for themselves and other users based on design criteria
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)

  • 5cStudents break problems into component parts, extract key information, and develop descriptive models to understand complex systems or facilitate problem-solving.
  • 6bStudents create original works or responsibly repurpose or remix digital resources into new creations.
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

  • 1.BCreativity and innovation. The student uses creative thinking and innovative processes to construct knowledge and develop digital products. The student is expected to: analyze trends and forecast possibilities, developing steps for the creation of an innovative process or product;
  • 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

  • Student Workbook for Exploring ParametersFile links loading
  • Triangle OutlineFile links loading
  • Square OutlineFile links loading
  • Pentagon OutlineFile links loading
  • Hexagon OutlineFile links loading
  • Octagon OutlineFile links loading
  • Decagon OutlineFile links loading

Educator resources

  • Teacher Guide LessonFile links loading
  • Presentation Slides for Exploring ParametersFile links loading

Lesson overview

Students have had a lot of practice building code to get Marty to carry out a specific task but how do we modify code blocks to change Marty’s behaviours when we pass different values to them?

In this lesson, we will further explore parameters in MartyBlocks and see the effect that changing arguments can have on the overall program.

This lesson could be extended to allow more time for learners to create different shapes.

Prerequisite knowledge

Knowledge of blocks, where values can change (movement blocks)

Cross-curricular links

Maths

Learning objectives

  • I can describe what parameters and arguments are.
  • I can create code that changes the output depending on the arguments used.

Resources and equipment

  • Marty the Robot
  • Marty Workbook
  • Tablets
  • Access to the MartyBlocks editor
  • Tape or pen and paper

Key vocabulary

  • Parameter
  • Argument
  • Changing behavior
  • Values
  • Code blocks

Lesson plan

Loops are not expressly referenced in this lesson, they will feature in the following lesson; however, you could use them in this lesson if you have already taught loops. Instead of making use of loops, each block of code could be created for one side and angle and learners would need to tap the block, or the flag, for the number of sides that exist for that shape, waiting until Marty completes the movement for each side / angle.

Warm-Up

Share with learners a video of a simple recipe that involves measuring ingredients and temperature for cooking; ingredients are parameters for a recipe. Have learners take down the values for the measurements, the arguments of the recipe, into their workbooks to keep track of what the cook used for the recipe.

Parameters and their arguments are important for a recipe's success. Have learners research the effect of changing the arguements of different parameters for the two recipes or for a different recipe.

The key for the warm-up is the definition of the two terms, parameter and argument. Having learners create a definition is the goal of the recipe videos and the regular use of the terms parameter and argument.

The following links will take you to websites describing the effect of changing the arguments for different parameters for recipes:

  • The difference temperature can make to a cake.
  • Too much flour.
  • Too much baking powder.
  • Too much sugar. (This one is a forum post with one interesting reply; lots of ads on the page.)
  • Too many eggs. (In a brownie recipe)

Get Learning

Show learners the code blocks for walking and making a turn. Ask learners to list shapes they know and some of their properties. Explore with learners what they would need to do to code the rest of a shape, once they walk one side and turn the degrees of an angle. A link to a video is included, below, and in the presentation showing Marty walking, making a 90 degree turn (approximately) and walking a second side. The argument for the angle parameter will need to be changed a bit to make Marty's movement look more like a 90 degree turn.

This code is OK for a single angle but should not be used for a shape, the shape should only have the side and turn for the angle.

It is important to teach that the angle that needs to be 'turned' is the difference between the angle in the shape and the straight line that is one of the line segments of the angle; for squares, the angle in the shape and the angle that Marty must turn is the same. There is a slide in the presentation to support learners, using a triangle, and how that is different to coding the turn for a square. This is important for shapes that do not have only right angles. This may be tricky for some so time is needed to use the code and see what happens when Marty turns the degrees that belong to the shape.

The activity in the workbook is a reminder for the number of sides each shape has and the total number of degrees for each of the angles. This table could also be used to support learners in finding the number of degrees for Marty to walk the perimter of a shape. Learners need to draw a line connecting the name, the description and the image of the shape. Additionally, there is a space for the supplementary angle to be filled in for each regular shape.

The video features Marty walking the perimeter of an equilateral triangle. This was not achieved in one attempt because Marty interacts with the environmernt and this affects the movements. Below are the videos for the attempts for Marty walking the triangle, the code that was used to achieve the results is in the teacher's guide.

Below are further examples of Marty walking the perimeter of various shapes. The square example is included in the presentation, along with the code that would create a square in a virtual environment. The code does not get Marty to walk the perimeter exactly, it needs some testing, some trial and error: learners will need to change the argument for the angle parameter. The code is provided so learners have a starting point.

Time for Practice

Learners need to investigate the number of degrees in a regular 2D shape.

  • A triangle has 180 degrees, each angle is 60 degrees.
  • A square has 360 degrees, each angle is 90 degrees.
  • A pentagon has 540 degrees, each angle is 108 degrees.
  • A hexagon has 720 degrees, each angle is 120 degrees.
  • An octagon has 1080 degrees, each angle is 135 degrees.
  • A decagon has 1440 degrees, each angle is 144 degrees.

They will need to also figure out the difference between the angle and the straight line. For each regular shape, Marty will need to have the same number of movement blocks as sides and the corect angle to turn at each vertex. The links below will take you to videos of the other shapes from the workbook. The code is in the teacher's guide. Feel free to share the videos with learners looking to challenge themselves. The decagon does not show the complete shape.

pentagon

hexagon

octagon

decagon

For the code, each of the turns are done in 6 steps. The reason for this is that 6 is an even number, and regular shape angles are generally divisible by 6, which allows Marty to get his feet level, via the get ready block, after each of the turns and before walking the next side. Having an odd number of steps makes the turn less accurate because the get ready command will be used on the wrong foot. Any even number will do but each of the turn steps should not exceed 30 degrees.

One other note is that learners can stipulate how long each step should be by using the same block as they do for turning but setting the turn to 0 degrees. Using the basic walk forward block will cause each step Marty takes to be 25mm in length.

Learners will see that the accurate maths angle for each vertex does not always result in Marty walking the perimeter perfectly: the surface Marty is placed on can cause friction or slippage which can result in a less than perfect angle walked. As a result, learners will absolutely need to 'iterate' their work. This means estimating about how muuch for each step based on how close the shape was with the exact measurement, and testing, testing, testing with each new estimate.

This process is likely to take some time, particularly with 6 shapes learners could program Marty to walk. The workbook features the shape name, shape description and an image of the shape. Additionally, each shape has an extension to a line segment where learners can record the angle of turn Marty will need to move through in order to create the shape.

Cool Down

Bring learners back together to discuss the challenges they faced and overcame. Have groups model their creations and explain what is happening, when. A good way to keep the modelling interesting is to have different groups display different shapes. One idea would be to do so in reverse order: it is unlikely that all groups will manage to complete all 6 shapes but some may. These examples may generate more questions than other groups because of the quantity of iteration that may be required.

Suggested questions you might ask:

  • What was the most challenging part about creating code for an accurate angle?
  • What steps did you take to improve on your earlier angles?
  • For our work today, what parts of the code were parameters and what parts were arguments?

Carry out any end of lesson routines.

Log off devices and clear everything away.

Watch on YouTube
Watch on YouTube
Watch on YouTube
Watch on YouTube
Watch on YouTube
Watch on YouTube
Watch on YouTube
Watch on YouTube