# Lesson 4: Drawing with Loops

## Overview

Watch student faces light up as they make their own gorgeous designs using a small number of blocks and digital stickers! This lesson builds on the understanding of loops from previous lessons and gives students a chance to be truly creative. This activity is fantastic for producing artifacts for portfolios or parent/teacher conferences.

## Purpose

This series highlights the power of loops with creative and personal designs.

Offered as a project-backed sequence, this progression will allow students to build on top of their own work and create amazing artifacts.

## 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 plenty of introduction to loops at this point. Based on what you think your class could benefit from, we recommend:

• Creating a new stack design with loops just like in "My Loopy Robotic Friends"
• Reviewing how to use Artist by playing through a puzzle from "Programming in Artist"
• Previewing a puzzle from this lesson

All of these options will either review loops or the artist, which will 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 before they program it online. (When drawing stamps, it can be easier to symbolize those with simple shapes like circles and squares.)

## 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 would like to program? Can you come up with the code to create it?
• Artist Intro with JR Hildebrande
• 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

"Hi, I'm an artist. You can write code to make me draw almost anything."

Play with the blocks in the toolbox to see what they do!

View on Code Studio

### Student Instructions

"Let's make a cage for my pet monster!"

Drag blocks onto the screen to have the artist draw over the grey lines in the picture.
(Each line is 100 pixels long)

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

### Student Instructions

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

### Student Instructions

"This spaceship needs a window!"

Each side of the inner square is 100 pixels and all of the angles are 90 degrees.

View on Code Studio

### Student Instructions

"Oh no! Starla's pet alien just flew away! Let's help the spacewoman!"

Finish Starla's rocket so she can chase her pet.
(Each side of the triangle is 100 pixels long and has 120 degree outer angles.)

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

### Student Instructions

Challenge: This tag is a special one!

Can you figure out how to draw the outline?
(The long side is 150 pixels and each of the short sides are 75 pixels.)

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.

• Practice
• 9
• 10
• (click tabs to see student view)
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.

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

### Student Instructions

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

View on Code Studio

### Student Instructions

Draw rooms for each of the animals. There are many different ways to solve this puzzle, so have some fun! Each square has a side length of 100 pixels.

View on Code Studio

### Student Instructions

"Help me paint the yellow lines on this road!"

The three line segments have lengths of 150, 100, and 200 pixels!

## Standards Alignment

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

AP - Algorithms & Programming
• 1B-AP-11 - Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.