Lesson 12: Fancy Shapes using Nested Loops
Overview
Students will create intricate designs using Artist in today's set of puzzles. By continuing to practice nested loops with new goals, students will see more uses of loops in general. This set of puzzles also offers a lot more potential for creativity with an opportunity for students to create their own design at the end of the stage.
Purpose
In this online activity, students will create designs in Artist that they can proudly share with their loved ones.
The purpose of this activity is to utilize nested loops as a way to inspire students with artistic minds to see coding as another creative outlet. This set of puzzles was built to develop critical thinking skills, an understanding of elementary geometry, and creativity -- all within the scope of nested loops!
Agenda
Warm Up (10 min)
Main Activity (30 min)
Wrap Up (15 min)
Extended Learning
View on Code Studio
Objectives
Students will be able to:
- Combine simple shapes into complex designs with nested loops.
- Count the number of times an action should be repeated and represent it as a loop.
- Break complex tasks into smaller repeatable sections.
Preparation
- Play through the puzzles to find any potential problem areas for your class.
- Make sure every student has a journal.
- Consider what supports your students might need with turns and angles.
Links
Heads Up! Please make a copy of any documents you plan to share with students.
For the Students
- Turns & Angles - Student Handout
- Turns & Angles - Student Video
Vocabulary
- Loop - The action of doing something over and over again.
- Repeat - To do something again.
Support
Report a Bug
Teaching Guide
Warm Up (10 min)
Introduction
Review using nested loops in Maze.
Ask the students how they felt about nested loops.
- What did they like and dislike about them?
- What are some advantages of using nested loops?
Tell the students that they will be using nested loops again, but in Artist this time. They will be making amazing projects today!
Main Activity (30 min)
Online Puzzles
Teacher Tip
Students will have the opportunity to share their own work at the end of this stage. These pieces of artwork can be shared virtually or printed out. We recommend printing out the class's work and displaying it for the students' loved ones to see.
Students might benefit from having a puzzle done as a class. If you believe your class could benefit from that, we recommend puzzle 2 of stage 5.
We highly recommend Pair Programming - Student Video in this lesson. This may not be an easy topic for the majority of your students. Working with a partner and discussing potential solutions to the puzzles might ease the students' minds.
Be sure to have paper and pencils nearby for students to write out their plan before coding. Some puzzles have a limit on the number of certain blocks, so paper can be helpful if students like to write out the long answer before searching for repeating patterns.
Wrap Up (15 min)
Flash Chat: What did you make today?
Get the class together and allow time for students to show off their Artist drawings! Make sure everyone feels included by checking that every student is done with their Artist drawing before starting the presentations. Discuss how each drawing was made and what was in the student's nested loop.
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?
- Draw something you used nested loops to make.
- How do nested loops help you code complex images?
Extended Learning
Together We Draw
Have the students pair up with two pieces of paper. Partners should individually draw a shape or simple pattern. Once the simple pattern has been drawn, have the partners switch papers. Now each partner must repeat that pattern how ever many times they want. For example, if one partner draws a square, the other partner can make a rectangle made up of squares! If one partner draws a staircase pattern, the other student can fill the page with staircases! Each pair will have a set of unique drawings. If there's time, have students discuss how they might code their drawings.
Student Instructions
Student Instructions
Now loop the triangle 6 times.
After each triangle, you'll need to turn 60 degrees before drawing the next.
- Video
- 3
Student Instructions
This time, complete the puzzle with the fewest number of blocks possible.
After each triangle, you'll need to turn 60 degrees before drawing the next. See how much easier this is with nested loops?
Student Instructions
Student Instructions
Great! Do the same thing with these circles.
- Each circle is made by moving 1 pixel before turning 1 degree, 360 times.
- Each circle begins just 50 pixels from where the last one ended
Student Instructions
What happens if you also turn 90 degrees between circles?
(To get this image, you still need to jump 50 pixels between circles)
Student Instructions
Use what you've learned to make this drawing.
- The squares each have 100 pixel sides and 90 degree angles
- You will need to turn 60 degrees between each square. Why? Because there are 6 squares, and 360 degrees (a full turn around) divided by 6 is 60 degrees.
- Make sure you jump 50 pixels to get to the next square
Student Instructions
Using what you have learned in the last couple of puzzles, build this image from the beginning.
- Each hexagon has 50 pixel sides and 60 degree turns
- Challenge
- 10
Student Instructions
Challenge: Can you figure out how to make a picture like this?
- Both shapes have 50 pixel sides
- Between each pair of shapes, you will need to jump forward the length of a side, and turn 45 degrees.
- Practice
- 11
Student Instructions
- Prediction
- 12
Student Instructions
A | B | C |
Take a good look at the code below. Which drawing will this program make when you click "Run"?
A
B
C
I don't know.
- Free Play
- 13
Student Instructions
Can you figure out how to make a picture like this?
- Both shapes have 50 pixel sides.
- The octagons are made with 45 degree turns.
- The triangles are made with 120 degree turns.
Student Instructions
This code is just a little bit off! Can you fix it to make the correct drawing in the workspace?
- The first inner loop should make an octagon.
- The second inner loop should make a hexagon.
- The third inner loop should make a square.
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.