EU Code Week 2020 - Day Two - Find Patterns

About this lesson

Today's Playground:
Learn to Code 1 playground
Learn to Code 1
Day two: find patterns playground image We keep going with the Learn to Code 1 playground.
Today's challenge is to start building our own commands to use, called functions.

We'll first figure out what sequence of commands we might use to make Byte turn right, when we only have moveForward() and turnLeft() available to us. How would you turn to face right if you were only able to move forward or turn left?

Today's session will teach us a little bit about how we organize our thinking and our code.

Video

Recorded *live* 19 November, 2020:

Recorded 18 November, 2020:

Unplugged Activity

Turning Left to Turn Right & The Dots Game

You will need:
  • Space to move around the room
  • A4 plain paper
  • Coloured pens or pencils

Activity:

We will explore moving around the classroom -- BUT you cannot turn right. How will you make it around the obstacles and people in your way?

Then we will play the 'Boxes' or 'Squares' game on paper. You and a partner can draw a grid of dots on a piece of paper (5 dots by 5 dots). You then take turns to draw a line connecting 2 dots. When you complete a box or square, write your initial in it. The player with the most boxes wins!

Extend

Extend: create functions from scratch!
You'll want to practice writing functions a bunch! As you become a more experienced coder, you'll organise your code in better ways and you'll group commands to take the most advantage of functions.

You can practice with the other playground pages from this section, like Collect, Toggle, Repeat, Across the Board, and Slotted Stairways.

But the real one to work on is the Treasure Hunt playground page. There you'll create your own function from scratch! Use the autocomplete bar to create the start of the function for you and work from there:
Extend: use the autocomplete bar


If you are ready to get into more complex functions, you can check out the extend recommendations for tomorrow's session.