Lesson 9: Snowflakes with Anna and Elsa

Overview

Now that students know how to layer their loops, they can create so many beautiful things. This lesson will take students through a series of exercises to help them create their own portfolio-ready images using Anna and Elsa's excellent ice-skating skills!

Purpose

In this series, students will get practice nesting loops while creating images that they will be excited to share.

Beginning with a handful of instructions, students will make their own decisions when it comes to creating designs for repetition. They will then spin those around a variety of ways to end up with a work of art that is truly unique.

Agenda

Warm Up (15)

Main Activity (30)

Wrap Up (15)

View on Code Studio

Objectives

Students will be able to:

  • Break apart code into the largest repeatable sequences using both loops and nested loops.
  • Recognize the difference between using a loop and a nested loop.
  • Describe when a loop, nested loop, or no loop is needed.

Preparation

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

Links

Heads Up! Please make a copy of any documents you plan to share with students.

For the Students

Vocabulary

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

Support

Report a Bug

Teaching Guide

Warm Up (15)

Introduction

Ask the class to discuss the last set of puzzles.

  • What did they like/dislike?
  • Which puzzles were hard? Why?
  • Which puzzles were easy? Why?
  • If you were to teach nested loops to a friend, what would you say to help them understand?

If there's time, give an introduction to the main characters of today's puzzles, Anna and Elsa from Frozen. Give the class the sister's back story if the class doesn't already know. To build excitement, tell the class they will be using nested loops to make some fantastic drawings with Anna and Elsa's ice skates!

Main Activity (30)

Online Puzzes

This set of puzzles is set up as a progression. This means every puzzle builds a foundation for the next puzzle. Students will enjoy making more and more interesting designs by making small and simple changes to code they have already written.

Wrap Up (15)

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?
  • When do you use a loop? When do you use a nested loop?
  • Thought exercise: Can you make everything a nested loop can with just a normal loop? Can you draw out an example?
    • Answer: Yes, you can, but it is a lot more difficult. Nested loops make programs simpler.
View on Code Studio

Student Instructions

“Hi, I’m Elsa of Arendelle, help me draw a shape.”

Draw a hexagon with 50 pixel long sides.


To draw a hexagon, you will need to: - move forward by 50 pixels - turn right by 60 degrees - repeat a total of 6 times

View on Code Studio

Student Instructions

“Good job!”

After your hexagon, turn right by 60 degrees, then draw a line that is 150 pixels long.

Finish by putting Elsa back to the center of the play area, using the jump to the middle center position block.

View on Code Studio

Student Instructions

“Let’s make a snowflake.”

To turn this code into a snowflake, nest all of the code inside of another repeat loop and run it a total of 6 times. You should only need to add one block.

View on Code Studio

Student Instructions

"Let's make our snowflakes special!"

Inspiration: Where do you need to add code if you want to draw a tiny square at the tip of each long line?


You can try whatever you want in this puzzle, but here is an idea:

Try making a tiny square at the end of each line - Each side should be 15 pixels long - You should turn by 90 degrees - Repeat those actions a total of 4 times

View on Code Studio

Student Instructions

"Try changing the shapes or the lengths of the lines to make this your own!"


Inspiration: You can change your drawing in any way you want, but here is an idea:

  • Try switching the types of shape in the middle of the snowflake with the one at the end of each line!
View on Code Studio

Student Instructions

"Let’s try something new. This time, skate in a zig-zag."


Inspiration: Try changing your long 150 pixel line into 6 short lines of 25 pixels

  • Turn by 45 degrees in alternate directions after each short line to get a zig-zag look
  • Where do you need to put a new repeat block to make this happen?
  • How many times do you have to repeat your pattern of 2 short lines to get 6 total?

Standards Alignment

View full course 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.
  • 1B-AP-13 - Use an iterative process to plan the development of a program by including others' perspectives and considering user preferences.