Snap Documentation
IntroductionGet startedGlossaryReferences
1.0.0
1.0.0
  • Introduction
  • Get started
    • The First Day
    • Algorithms
    • Programming Languages
    • SNAP Self-Portrait
      • Do now
        • I Am ...
      • Labs
        • Getting to Know You
  • Snap!
    • Getting started with Snap!
      • Labs
        • Welcome to Snap! - Part 1
        • Welcome to Snap! - Part 2
    • Building Blocks
      • Do now
        • Tracing and Debugging
      • Labs
        • SNAP Scavenger Hunt
    • Drawing Shapes
      • Do now
        • Drawing a Triangle
      • Labs
        • Squares, Triangles, and Stars, Oh My!
    • Costumes
    • Animation
      • Do now
        • Sprite Communication
      • Labs
        • Sprites in Action
    • Storytelling
      • Do now
        • Knock Knock
        • Click Event Interaction
        • Movement Interaction
    • Project
      • Animated Storytelling
  • Loops
    • Loops
      • Do now
        • Introduction to Loops
      • Labs
        • Squares and Triangles Redux
    • Nested Loops
      • Do Now
        • Debugging Loops
      • Labs
        • Yellow Brick Road
    • Inputs and Conditionals
      • Do now
        • Stairs
      • Labs
        • What Shape is That?
    • Variables
      • Do now
        • Debugging
      • Labs
        • Guessing Game
    • Boole in the House
      • Do now
        • Variables Practice
      • Labs
        • Triangles of All Kinds
    • Combining Loops and Conditionals
      • Do now
        • Boolean Practice
      • Labs
        • What Goes Up...
    • Quiz
      • Loops
    • Pong
      • Do Now
        • Bouncing Ball
    • Project
      • Pong
      • Pong - Alternative
  • Customization
    • Abstraction and Friends
    • Procedures
      • Do now
        • Drawing Squares
      • Labs
        • Drawing Shapes
    • Customization - Part 1
      • Do now
        • Jumping
      • Labs
        • Let Me Check My Calendar
    • Customization - Part 2
      • Do now
        • Practice using Arguments
      • Labs
        • If My Calculations Are Correct...
    • Quiz
      • Customization
    • Project
      • Platform Game
      • Platform Game - Alternative
  • Lists
    • Intro to Lists
    • Static Lists
      • Do now
        • Letters of a Word
      • Labs
        • You Talkin' to Me?
    • List Practice - Part 1
      • Do now
        • Quote of the Day
      • Labs
        • Guess Who
    • List Practice - Part 2
      • Do now
        • Traversing List
      • Labs
        • Number Cruncher
    • Sequential Search
      • Do now
        • List Tracing
      • Labs
        • It's Around Here Somewhere
    • Lists
    • Guess My Word
      • Do now
        • Gentle Guess My Word
    • Project
      • Guess My Word
  • Cloning
    • Introduction to Cloning
      • Labs
        • Connect the Dots
    • Cloning Sprites
      • Do now
        • Star Wars Troopers
      • Labs
        • Lots of Balls
    • Communicating with Clones
      • Do now
        • Star Wars Troopers using Cloning
      • Labs
        • Fewer Balls
    • Quiz
      • Cloning
    • Space Invaders
    • Project
      • Space Invaders
  • Final Project
    • Design Basics
    • Research and Ideate
    • Defining Requirements
    • Building a Plan
    • Project Implementation
    • Project
  • References
    • How to's
      • Create Snap Account
      • Save & Share Projects
      • Snap Window
      • Sprites
      • Scripts
      • Movement & Position
      • Drawing
    • Readability
    • Snap elements
      • Motion
      • Looks
      • Sound
      • Pen
      • Control
      • Sensing
      • Operators
      • Variables
  • Glossary
Powered by GitBook
On this page
  • Lab
  • Section 1 - Back In Time
  • Section 2 - Simplifying Code
  • Section 3 - Adding More Shapes
  • Grading Scheme/Rubric

Was this helpful?

  1. Loops
  2. Loops
  3. Labs

Squares and Triangles Redux

PreviousLabsNextNested Loops

Last updated 5 years ago

Was this helpful?

Lab

In this lab, you will rewrite your SNAP programs from Lab 1.3 to draw shapes using loops.

Section 1 - Back In Time

  1. Open your solution to the original "Squares and Triangles and Stars, Oh My!" activity. Go to the "File" menu and select "Save as..." to give your project a new name.

Section 2 - Simplifying Code

  1. Look at your code to draw a square. It is probably quite long and has lots of repeated blocks. Using what you have learned about loops, rewrite this script to be shorter and have less redundancy. Make sure that your code still works as originally intended.

  2. Now modify your other shape scripts to also use loops. In all cases, try to have as few blocks and as little redundancy as possible while still keeping your code easy to read and understand.

Section 3 - Adding More Shapes

  1. Add code to your program to draw the extra shapes below. Follow all the original guidelines (different color and line thickness for each shape, say the name while drawing) and use loops to keep your scripts as short as possible.

When this key is pressed...

Draw a...

7

Decagon (10-sided polygon)

8

Circle

You may not be able to draw a true circle, but you should get as close as you can.

Grading Scheme/Rubric

Lab 2.1 Criteria

2.2 Square using loop

0.5 points

Section 3

Decagon

0.5 points

Circle

0.5 points

Minimum redundancy in all

0.5 points

PROJECT TOTAL

2.0 points