Computer ScienceGrades 3-5Beginner

    Algorithm Art with Loops

    Discovering repetition patterns through visual code

    50 minIndividual or pairs5E Model

    Lesson Overview

    Students write their first loop programs using block-based coding to create repeating geometric art patterns. They discover how loops reduce code repetition, predict the output of loop programs, and debug broken loop sequences β€” aligned to CSTA 1B-AP-10 and 1B-AP-11.

    Learning Objectives

    Students will be able to:

    • Explain what a loop is and why programmers use them
    • Write a loop that repeats a sequence of steps a specific number of times
    • Predict the output of a loop program before running it
    • Identify and fix a bug in a loop program

    Lesson Phases (5E Model)

    • 1Stand up: 'We're going to follow an algorithm. Ready? Step right, step left, clap, clap. Now repeat that 4 times.'
    • 2Students perform it β€” ask: 'Was it easier to remember all 16 steps, or just repeat the pattern 4 times?'
    • 3Connect to programming: 'That's a loop! Instead of writing the same steps over and over, we tell the computer to REPEAT.'
    • 4Show two versions of the same program on the projector β€” one with copy-pasted blocks, one with a loop. Ask: 'Which would you rather write?'

    Assessment Strategies

    Loop Prediction Worksheet

    Scored on accuracy of predictions β€” demonstrates loop comprehension before coding

    Algorithm Art Program

    Evaluated on: working loop, correct iteration count, and creative pattern

    Gallery Sticky Note

    Formative check β€” can students identify loop iteration count in peers' code?

    Extension Activities

    • β†’Explore nested loops β€” a loop inside a loop (Code Academy Level 2 content)
    • β†’Math connection: calculate the number of degrees per turn for any regular polygon
    • β†’Challenge: create animated loop art where the pattern changes color each iteration
    • β†’Real-world connection: find examples of loops in everyday technology (traffic lights, music playlists)

    At a Glance

    Grade BandGrades 3-5
    Duration50 min
    Group SizeIndividual or pairs
    DifficultyBeginner
    SubjectComputer Science
    Lesson Model5E Instructional Model

    Materials

    • Devices with access to Code Academy or Scratch1 per student/pair
    • Loop prediction worksheets (unplugged)1 per student
    • Graph paper for pattern sketching1 per student
    • Colored pencils or markers1 set per student
    • Algorithm Art Gallery wall spaceClass shared

    Key Vocabulary

    Loop
    A programming instruction that repeats a set of steps a certain number of times
    Iteration
    One time through a loop β€” if a loop runs 5 times, it has 5 iterations
    Pattern
    A design or sequence that repeats in a predictable way
    Bug
    A mistake in a program that causes it to behave incorrectly
    Debug
    Finding and fixing bugs in a program

    Standards Alignment

    CSTA
    1B-AP-101B-AP-111B-AP-14

    CS Teachers Association K-12 Standards

    Digital Tools

    • β†’Code Academy β€” Loops & Repetition Lessons
    • β†’Code Academy Scratch Integration

    Bring this curriculum to your school

    Schedule a meeting with our team to discuss district-wide implementation.