# Lesson 8: Drawing Shapes with Loops

## Overview

This lesson builds on the understanding of loops from previous lessons and gives students a chance to be truly creative. This activity doubles as a debugging exercise for extra problem-solving practice.

## Purpose

This series highlights the power of loops with an array of puzzles meant to get students thinking about why `repeat` loops are superior to longhand.

## Objectives

### Students will be able to:

• Identify the benefits of using a loop structure instead of manual repetition.
• Differentiate between commands that need to be repeated in loops and commands that should be used on their own.

## Preparation

• Play through the puzzles to find any potential problem areas for your class.
• Make sure every student has a journal.

## Vocabulary

• Loop - The action of doing something over and over again.
• Repeat - To do something again.

# Teaching Guide

## Warm Up (15 min)

### Introduction

Students should have had an introduction to loops at this point. Based on what you think your class could benefit from, we recommend:

• Creating a new dance with loops just like in "Getting Loopy"
• Reviewing a puzzle from the last lesson
• Previewing a puzzle from this lesson

Any of these should help prepare your class for fun with the online puzzles!

## Main Activity (30 min)

### Online Puzzles

Some students may discover where to add `repeat` loops by writing out the program without loops then circling sections of repetitions. If the students in your class seem like they could benefit from this, have them keep paper and pencils beside them at their machines. Students might also enjoy drawing some of the shapes and figures on paper as they program online.

## Wrap Up (15 min)

### Journaling

Having students write about what they learned, why it’s useful, and how they feel about it can help solidify any knowledge they obtained today and build a review sheet for them to look to in the future.

#### Journal Prompts:

• What was today’s lesson about?
• How did you feel during today’s lesson?
• What was the coolest shape or figure you programmed today? Draw it out!
• What is another shape or figure you could program using loops? Can you come up with the code to create it?
• Artist Intro with JR Hildebrand
• 1
• (click tabs to see student view)
View on Code Studio

### Student Instructions

• Practice
• 2
• 3
• (click tabs to see student view)
View on Code Studio

### Student Instructions

What a lovely day!

Help the Artist cover his flowers before the winter by moving forward by 60 pixels.

View on Code Studio

### Student Instructions

Add some beauty by repeating that step five times, changing to a random color between each move.

• Loops with the Artist
• 4
• (click tabs to see student view)
View on Code Studio

### Student Instructions

View on Code Studio

### Student Instructions

Draw the colorful line 5 times again, this time using a `repeat` loop.

View on Code Studio

### Student Instructions

You can create this star by looping a sequence of `move forward` and `turn right by 144 degrees` blocks.

View on Code Studio

### Student Instructions

Loops sure make writing code easier!

Use loops to draw this staircase. - Each stairstep is 50 pixels long and 50 pixels tall - You will need to turn 90 degrees in each direction

View on Code Studio

### Student Instructions

This staircase is much bigger, but it takes the same amount of code as the last puzzle!

Fix this loop to complete the puzzle.

View on Code Studio

### Student Instructions

Look for a pattern and make this code shorter using loops!

• Challenge
• 10
• (click tabs to see student view)
View on Code Studio

### Student Instructions

Challenge: Look for a pattern and make this code shorter using loops.

• Practice
• 11
• (click tabs to see student view)
View on Code Studio

### Student Instructions

Solve this puzzle by drawing a square with 200 pixel sides.

## Standards Alignment

#### CSTA K-12 Computer Science Standards (2017)

AP - Algorithms & Programming
• 1A-AP-09 - Model the way programs store and manipulate data by using numbers or other symbols to represent information.
• 1A-AP-10 - Develop programs with sequences and simple loops, to express ideas or address a problem.
• 1A-AP-11 - Decompose (break down) the steps needed to solve a problem into a precise sequence of instructions.
• 1A-AP-14 - Debug (identify and fix) errors in an algorithm or program that includes sequences and simple loops.

## Cross-curricular Opportunities

This list represents opportunities in this lesson to support standards in other content areas.

#### Common Core English Language Arts Standards

L - Language
• 2.L.6 - Use words and phrases acquired through conversations, reading and being read to, and responding to texts, including using adjectives and adverbs to describe (e.g., When other kids are happy that makes me happy).
SL - Speaking & Listening
• 2.SL.1 - Participate in collaborative conversations with diverse partners about grade 2 topics and texts with peers and adults in small and larger groups.

#### Common Core Math Standards

G - Geometry
• 2.G.1 - Recognize and draw shapes having specified attributes, such as a given number of angles or a given number of equal faces.5 Identify triangles, quadrilaterals, pentagons, hexagons, and cubes.
MP - Math Practices
• MP.1 - Make sense of problems and persevere in solving them
• MP.2 - Reason abstractly and quantitatively
• MP.5 - Use appropriate tools strategically
• MP.6 - Attend to precision
• MP.7 - Look for and make use of structure
• MP.8 - Look for and express regularity in repeated reasoning
OA - Operations And Algebraic Thinking
• 2.OA.1 - Use addition and subtraction within 100 to solve one- and two-step word problems involving situations of adding to, taking from, putting together, taking apart, and comparing, with unknowns in all positions, e.g., by using drawings and equations with a sy

#### Next Generation Science Standards

ETS - Engineering in the Sciences
ETS1 - Engineering Design
• K-2-ETS1-1 - Ask questions, make observations, and gather information about a situation people want to change to define a simple problem that can be solved through the development of a new or improved object or tool.
• K-2-ETS1-2 - Develop a simple sketch, drawing, or physical model to illustrate how the shape of an object helps it function as needed to solve a given problem.
• K-2-ETS1-3 - Analyze data from tests of two objects designed to solve the same problem to compare the strengths and weaknesses of how each performs.