Floor Grid Coding: Loops on the Move

← Free Lesson Plans for Teachers

Free Lesson Plan

Grades K–3Engineering & Coding45 min1A-AP-081A-AP-101A-AP-14

⬇ Download PDF (lesson, student sheets & answer key)

Driving question: How can a short loop replace a long list of steps?

Overview

Students code with their whole bodies on a 5 × 5 floor grid made of masking tape (or test the same paths on a tabletop grid mat with counters or a small robot). A “programmer” lays arrow cards to guide a “robot” classmate from the start square to a star. After writing long lists of arrows, students learn to shorten them with a repeat loop: "repeat 3 [right]" means move right three times.

Students write algorithms as step lists, use loops, and find and fix bugs in a program. The same arrow cards and puzzles work later with any floor robot.

Standards

CodeStandard
CSTA 1A-AP-08 (2017)everyday routines as a list of steps
CSTA 1A-AP-10 (2017)order of steps and repeats
CSTA 1A-AP-14 (2017)finding and fixing program errors

Grades K–2: 1A codes. Grade 3: early practice toward 1B-AP-10 (loops). CSTA codes are from the CSTA K-12 CS Standards (2017); the short labels are our own summaries, not CSTA wording. This lesson has not been reviewed or endorsed by CSTA.

Learning Objectives

Students will:

  • write a sequence of arrow steps to reach a goal.
  • replace repeated steps with a loop.
  • find and fix a bug in a program.

Materials

Geyer resources for this lesson

Also needed

  • Masking tape for a 5 × 5 floor grid (squares about 30 cm), or a tabletop coding mat
  • Arrow cards and repeat cards (Student Sheet 1), cut apart; a star card for the goal; “block” cards for obstacles
  • Student Sheets 2-3

Vocabulary

WordWhat it means
algorithmA list of steps to do a task.
programSteps written so a robot or computer can follow them.
loopRepeating steps; “repeat 3 [right]” means right, right, right.
bugA mistake in a program.
debugTo find and fix a bug.

Safety Notes

  • Walk, do not jump, between squares. Keep the grid clear of bags and chairs.
  • Tape the grid flat so no one trips on loose edges.

Before You Teach

  • Tape a 5 × 5 grid on the floor. Cut out arrow and repeat cards (one set per group).

Warm-Up (5 min)

  • Ask students to give you step-by-step directions to walk to the door. Follow them exactly, even when they are wrong. Ask: "Why do robots need exact steps?"

Procedure

Arrow coding (15 min)

  1. Explain: each arrow moves the robot one square in that direction (up = toward the front wall). The robot does not turn; it steps.
  2. Place the robot on start (S) and the star. The programmer lays arrow cards; the class reads them aloud as the robot walks.
  3. Solve Puzzles 1 and 2 on Student Sheet 2 on the floor, then on paper.

Loops (15 min)

  1. Ask: "Puzzle 2 used . Is there a shorter way?" Introduce the repeat card: repeat 4 [].
  2. Solve Puzzle 3 (staircase) with a loop: repeat 3 [ ].
  3. Partners write a loop for Puzzle 4 and test it on the floor.

Debug and share (10 min)

  1. Run the buggy program on Student Sheet 3 with a robot. Where did it go wrong? Fix it.
  2. Share: how many cards did a loop save?

Differentiation

SupportOn-levelChallenge
• Use a 3 × 3 grid and arrows only.
• Teacher reads cards; students point.
• Complete the procedure and student sheets as written.• Create a puzzle with two blocks for a partner, and write the shortest program with loops.
• Use turn cards (turn left, turn right, forward) instead of arrows.

Assessment

  • Check that programs reach the star.
  • Ask students to read a loop aloud as a list of steps.

Exit ticket: Ask: "Write repeat 3 [] as a list of arrows." ( .)

CriterionBeginningDevelopingProficient
SequenceDoes not reach goalReaches with helpReaches goal on own
LoopsNo loopsUses a loop with helpUses loops to shorten programs
DebugCannot find bugFinds bugFinds and fixes bug

Extensions

  • Program a floor robot with the same puzzles.
  • Related: coding lessons 48 and 49 in the hub; Robot Starter Stations (Lesson 520).

Student Sheets

Use these sheets in class, or download the PDF for a print-ready layout.

Student Sheet 1

Arrow and Loop Cards (cut apart)

Print-ready version in the PDF.

Name: ______________________________   Date: ______________

repeat 2 [ ]repeat 3 [ ]repeat 4 [ ]goal

Student Sheet 2

Grid Puzzles

Print-ready version in the PDF.

Name: ______________________________   Date: ______________

S = start. = goal. Gray squares are blocked. Each arrow moves one square.

Puzzle 1
S
Code:
Puzzle 2
S
Code:
Puzzle 3 (loop)
S
Code:
Puzzle 4 (loop)
S
Code:

Student Sheet 3

Fix the Bug

Print-ready version in the PDF.

Name: ______________________________   Date: ______________

This program should take the robot from S to the . Run it with your finger.

S

Program: repeat 4 [ ]

Where does the robot end up?

Fixed program:

Show answer key (for teachers)

Answer Key & Teacher Notes

Answer Key

  • Puzzle 1: ; with a loop: repeat 3 [ ].
  • Puzzle 2: ; with a loop: repeat 4 [ ].
  • Puzzle 3: ; with a loop: repeat 3 [ ].
  • Puzzle 4: ; with a loop: repeat 4 [ ] .
  • Bug: repeat 4 [ ] moves 4 squares right, one too many, and ends one square to the right of the star (off by one). Fix: repeat 3 [ ] .
  • Exit ticket: .
SSSS

Need a print-ready copy? The PDF includes the lesson, student sheets, and answer key.

Download the PDF  |  All free lesson plans

Free for classroom use. You may print and copy this lesson for your students. © Geyer Instructional Products. Standards text: CSTA K-12 CS Standards © CSTA.