1 of 17

My Loopy Robotic Friends Jr.

2 of 17

My Loopy Robotic Friends Jr.

Standards:

2.AP.M.1 - Break down (decompose) the steps needed to solve a problem into a precise sequence of instructions.

2.AP.C.1 - Develop programs with sequences and simple loops, to express ideas or address a problem.

Students will be able to:

  • Identify repeated patterns in code that could be replaced with a loop.
  • Write instructions that use loops to repeat patterns.

3 of 17

Warm Up

4 of 17

My Loopy Robotic Friends Jr. - Warm Up

Reflect:

In the previous lesson, which shapes repeated lines of code?

What lines of code did they repeat?

5 of 17

My Loopy Robotic Friends Jr. - Warm Up

Loop - The action of doing something over and over again.

Repeat - To do something again.

Vocabulary

6 of 17

My Loopy Robotic Friends Jr. - Warm Up

Remember This?

Pick Up Cup

Put Down Cup

Step Forward

Step Backward

7 of 17

My Loopy Robotic Friends Jr. - Warm Up

Now Try This!

Pick Up Cup

Put Down Cup

Step Forward

Step Backward

8 of 17

My Loopy Robotic Friends Jr. - Warm Up

One More Time!

Pick Up Cup

Put Down Cup

Step Forward

Step Backward

9 of 17

Activity

10 of 17

My Loopy Robotic Friends

My Loopy Robotic Friends Jr. - Activity

Think - Pair - Share

Where in this program can you find a pattern of instructions that repeat uninterrupted (one arrow repeated over and over)?

11 of 17

Sample Answer

My Loopy Robotic Friends Jr. - Activity

Where in this program can you find a pattern of instructions that repeat uninterrupted (one arrow repeated over and over)?

4

12 of 17

My Loopy Robotic Friends Jr. - Activity

Looping Your Robots

  • Once you are in your group, divide into partners
  • Look at Cup Stacking Ideas
  • With your partner, choose one design for your robot to do

13 of 17

My Loopy Robotic Friends Jr. - Activity

The “Program”

  • Discuss how the stack should be built, using only arrows.
  • Write down your algorithm on a piece of paper.
  • Replace any repeated actions with a loop.

14 of 17

My Loopy Robotic Friends Jr. - Activity

Running and Debugging Your Robots

  • Now it’s time to be a robot! Trade algorithms with the other partners in your group.
  • Be on the lookout for bugs. If you see one, have the robot finish the instructions as best as it can.
  • Discuss the bug with your partners and come up with a solution.
  • Keep testing the algorithm until it works!

15 of 17

My Loopy Robotic Friends Jr.- Activity

Discuss

Time to share your solution with your classmates.

  • Did you identify any loops?
  • Are there other ways those loops could have been written? How?

16 of 17

Wrap Up

17 of 17

My Loopy Robotic Friends Jr. - Wrap Up

Reflect:

Is it easier to understand programs with loops, or programs written out longhand? Why?