1 of 16

Lesson 2: Turn Around

Challenge focus: 6 - 10

Coding concepts: Turn function with arguments (right, left)

Coding Adventure Part I

Key stage II

Class IV

2 of 16

Lesson Overview

Challenge Range

Coding Concepts

Sub Concepts

Resources

6-10

Sequence

  • Turn function with argument (left, right)

Lesson Plan 23

Turn Around

Coding Adventure Part I

Key stage II

Class IV

3 of 16

Lesson Objectives

  • Review the previous lesson.
  • Identify the different ways to use ‘turn’ instructions.
  • Complete challenges 6 - 10.

Coding Adventure Part I

Key stage II

Class IV

4 of 16

Understanding Function

  • A function is a set of instructions that perform a �specific action.
  • Some examples of built-in functions are:
  • turn (left, right)
  • step
  • The input that we pass to the function is called an argument.

turn 10

function

argument

Coding Adventure Part I

Key stage II

Class IV

5 of 16

Concept Continue…

  • Walking backward is pretty easy.
  • If we want to go forward 15 steps, we type ‘step 15’.
  • If we want to go backwards, we type ‘step -15’.

Coding Adventure Part I

Key stage II

Class IV

6 of 16

Demo 1

  1. Study the given challenge.
  2. Write a code to collect the banana.
  3. Use the functions (step, turn, left, right)

Coding Adventure Part I

Key stage II

Class IV

7 of 16

Demo 1 Solution

Coding Adventure Part I

Key stage II

Class IV

8 of 16

Activity 1

Study the code given below and rewrite it to collect the banana.

Coding Adventure Part I

Key stage II

Class IV

9 of 16

Activity 1 Solution

Coding Adventure Part I

Key stage II

Class IV

10 of 16

Activity 2

  1. Study the given challenge carefully.
  2. Write algorithm to solve the challenge in your notebook.
  3. Type the codes to check the solution.

Coding Adventure Part I

Key stage II

Class IV

11 of 16

Activity 2 Solutions

2

3

Coding Adventure Part I

Key stage II

Class IV

12 of 16

Activity 3

  1. Log into your CodeMonkey account.
  2. Open Coding Adventure Part 1
  3. Complete challenges 9 and 10. Challenge 6 and 7 have already been demonstrated to you earlier.

Coding Adventure Part I

Key stage II

Class IV

13 of 16

Activity 3 Solution

9

Coding Adventure Part I

Key stage II

Class IV

14 of 16

Activity 3 Solution

10

Coding Adventure Part I

Key stage II

Class IV

15 of 16

Story Mode Vs Skill Mode

  • Emphasizes engagement through storytelling.
  • Mandatory.
  • Focuses on practical skill development.
  • optional.

Coding Adventure Part I

Key stage II

Class IV

16 of 16

Key Points

  • A function is a set of instructions that performs a specific action when called (example: turn right).
  • A function takes an argument and returns it to the calling function.

1

#Example of passing an argument

2

turn 45 #turn is the function and 45 is argument.

Coding Adventure Part I

Key stage II

Class IV