**Turtle Power**

In this lesson, students are introduced to algorithms using the turtle library in TouchDevelop

**Suggested time:**50 mins

**Learning Objectives:**

- Understand and use sequence in an algorithm
- Understand and use iteration in an algorithm (FOR and WHILE loops)

**Curriculum Mapping:**

*KS2:*- Design, write and debug programs that accomplish specific goals; solve problems by breaking them into smaller parts. Select, use and combine a variety of software on a range of digital devices to design and create a range of programs.
- Use sequence, selection and repetition in programs; work with variables and various forms of input and output
- Use logical reasoning to explain how some simple algorithms work; detect and correct errors in algorithms and programs

*KS3:*- Use two or more programming languages, at least one of which is textual, to solve a variety of computational problems.

**What you will need:**

- Web enabled device (PC, Tablet, Phone) with an up-to-date browser (Internet Explorer, Safari, Chrome)
- TouchDevelop Web App (www.touchdevelop.com)

**Introduction: What are Algorithms?**

An algorithm is a basically a sequence of instructions for solving a problem or making something happen. For example, a recipe, instructions for making a cup of tea or storyboard for an animation are all examples of algorithms.

**Lesson Outline:**

In this lesson, students are going to learn how to create simple algorithms to control a turtle.

**Starter:**

To make a computer program, you need to understand how computers follow instructions.

*KS2 – Jam sandwich exercise*Instruct students to create an algorithm from set commands to program their teacher (sandwich bot) to make a jam sandwich.

**Students must write a set of working instructions, using commands such as Pick Up and Put Down, which the teacher has to follow**

*How it works:***precisely**in order to make a jam sandwich.

**If you're not a big fan of mess, I suggest replacing the jam with something less messy such as cheese or ham! To find out more, check out this lesson plan, courtesy of Phil Bagge, CAS Primary Master Teacher (@baggiepr): Jam Sandwich Algorithm (programming teacher bot)**

*Tip:*

*KS3/4 – The robot game*Ask for volunteer (Inform them that they will be blindfolded!) Tell the volunteer that they are going to act as the “the robot”. Next, ask someone to secretly position an object (e.g. pen or sweet etc.) somewhere around the room.

**Don’t make it too difficult or dangerous! Once the object has been placed, ask for another volunteer. Inform the second volunteer that they are going to program the robot, using only the given commands to guide the robot to the object, as efficiently as possible! Commands: Forward x spaces, back x spaces, left turn, right turn.**

*Tip:*After either of the two starter activities, ask students why the robot found it difficult to follow the instructions. Draw out answers such as “The instructions were too vague” or “The instructions were not specific”. Explain to students that computers (such as robots) can’t think for themselves, and that they can only follow instructions. Explain to students that we call these instructions ‘Algorithms’ and that an algorithm is a basically a sequence of instructions for solving a problem or making something happen for example, a recipe, instructions for making a cup of tea or storyboard for an animation.

**Activity 1:**

Explain to students that they are going to create some simple algorithms to control a turtle. Direct students to the tutorials below and ask them to follow the instructions:

td_turtle_power.pptx | |

File Size: | 1016 kb |

File Type: | pptx |

**Worksheet:** turtle_power_tutorial.docx | |

File Size: | 419 kb |

File Type: | docx |

*Extension:*Once students have mastered the basics, they can have a go at designing their own shapes! Here are some ideas to get them started:

Click here to see examples created by students.

Pick students at random to show off their artwork.

**Plenary:**Pick students at random to show off their artwork.

**Homework:**

Students can continue to work on their turtle art and publish their artwork when they have finished.

**Keywords:**Algorithm; Sequence; Iteration

**Licence:**

Unless otherwise specified, everything in this repository is covered by the following licence:

TouchDevelop "Turtle Power" lesson is licenced under a Creative Commons Attribution 4.0 International License.