Code the Mouse to the Cheese

← Free Lesson Plans for Teachers

Free Lesson Plan

Grades K-1Engineering & Coding45 minCode & Go1A-AP-101A-AP-14K.G.A.1

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

Driving question: How can we give a robot step-by-step directions to reach a goal?

Overview

Students plan a path for a programmable robot mouse to reach the cheese. They lay out coding cards in order (forward, turn left, turn right), enter the steps on the mouse, press go, and watch. When the mouse misses, students find the mistake and fix it: debugging.

Position words from kindergarten geometry (above, below, beside, next to) help students talk about where the mouse and cheese are on the grid.

Standards

CodeStandard
CSTA 1A-AP-10 (2017)algorithms & programming
CSTA 1A-AP-14 (2017)finding and fixing program errors
CCSS Math K.G.A.1Describe objects in the environment using names of shapes, and describe the relative positions of these objects using terms such as above, below, beside, in front of, behind, and next to.

CSTA K-12 CS Standards (2017), Level 1A (grades K-2). This lesson connects to these standards; it has not been reviewed or endorsed by CSTA. It addresses the sequence and debugging parts of 1A-AP-10 and 1A-AP-14. The Code & Go mouse has no loop command; a repeat-card challenge introduces an early idea of a loop. CSTA released updated PK-12 standards in 2026; this lesson cites the 2017 codes, which still match the activities. K.G.A.1 is a kindergarten geometry standard (grade 1 has no matching CCSS position standard).

Also listed with these standards

TypeConnection
K.G.A.1: Standards for Mathematical PracticeMP.4 Model with mathematics; MP.6 Attend to precision.

Learning Objectives

Students will:

  • put direction cards in order to build a sequence (program) that moves the robot mouse to the cheese.
  • test the program, find an error, and fix it.
  • describe the positions of the mouse and cheese using words such as above, below, beside, and next to.

Materials

Geyer resources for this lesson

Also needed

  • 3 AAA batteries per mouse (not included)
  • Masking tape to make a large floor grid if you want a "human robot" warm-up
  • Student Sheets 1 and 2 (below and in the PDF), pencils

Vocabulary

WordWhat it means
codeDirections a robot can follow.
sequenceSteps in order: first, next, last.
programA set of steps we give a computer or robot.
debugFind and fix a mistake in a program.
forwardMove ahead in the direction you are facing.
turnChange the way you face (left or right) without moving to a new square.

Safety Notes

  • Install batteries yourself and keep battery doors closed with the screw.
  • Small parts (walls, tunnels, cheese) are choking hazards for very young children. Count and collect pieces.
  • Keep the mouse on the table or mat; do not drop it from desks.

Before You Teach

  • Install batteries and test the mouse. Practice: each forward press moves one square; turns happen in place.
  • Set up 3-4 stations with a grid (maze grids or the blank grid mat), one mouse, cards, and the cheese.
  • Make a large tape grid on the floor for the human-robot warm-up (optional).

Warm-Up (8 min)

  • Play "Human Robot": a student stands on a floor grid. The class gives directions with cards: forward, turn left, turn right. The "robot" follows exactly, even if the directions are wrong!
  • Ask: "What happened when we gave the steps in the wrong order?"

Procedure

Meet the mouse (7 min)

  1. Show the mouse buttons and the matching coding cards.
  2. Place the mouse and cheese on the grid. Ask: "Where is the cheese? Is it above, below, or beside the mouse?"
  3. Build a short program together with cards (forward, forward). Enter it, press go, and watch.

Plan, code, test (20 min)

  1. Each group places the cheese 2-4 squares away. Students lay out cards in a row to plan the path.
  2. One student enters the steps while another reads the cards aloud. Press go.
  3. If the mouse misses: "Debug!" Students touch each card while watching where the mouse should be, find the wrong step, fix it, clear the old program, and try again.
  4. Rotate roles (planner, coder, reader, checker). Add one maze wall each round to make it harder.

Paper puzzles (7 min)

  1. Students solve the grid puzzles on Student Sheet 1 by drawing cards in the boxes.
  2. Early finishers test one paper solution on a real grid.

Share (3 min)

  1. Ask: "What bug did your group find? How did you fix it?" Record class debugging tips (check turns, start facing the right way, clear the old program).

Differentiation

SupportOn-levelChallenge
• Use only forward moves first, then add one turn.
• An adult enters the steps while the student reads the cards.
• Use the blank grid mat with large squares.
• Complete the procedure and student sheets as written.• Add a second goal: reach the cheese, then go to a tunnel.
• Find the shortest program (fewest cards).
• Use a repeated pattern of cards to make a square path, an early idea of a loop.

Assessment

  • Watch whether students plan before pressing buttons.
  • Listen for position words and "debug" talk.
  • Check paper puzzle solutions.

Exit ticket: Show a mouse 2 squares below the cheese, facing up. "What cards do we need?" (forward, forward)

CriterionBeginningDevelopingProficient
Builds a sequencePresses buttons at randomBuilds a sequence with helpPlans the full sequence with cards before coding
DebugsStarts over without looking for the errorFinds the error with helpFinds and fixes the wrong step
Uses position wordsPoints onlyUses one position wordDescribes positions with above, below, beside, or next to

Extensions

  • Make a story mat: the mouse visits places in a story in order (sequence in literacy).
  • Students design a maze for a partner and trade.
  • Grade 5: try the coordinate grid ideas in Lesson 16 (Coordinate Plane Treasure Map).

Student Sheets

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

Student Sheet 1

Help the Mouse Find the Cheese

Print-ready version in the PDF.

Name: ______________________________   Date: ______________

Code cards:   ↑ = forward 1 square    ↶ = turn left    ↷ = turn right

Puzzle 1. The mouse faces up (the black point). Draw the code cards in order.

STARTCHEESE
1234567

Student Sheet 2

Debug the Program

Print-ready version in the PDF.

Name: ______________________________   Date: ______________

Code cards:   ↑ = forward 1 square    ↶ = turn left    ↷ = turn right

Puzzle 2. Gray squares are walls. The mouse faces up. Draw the code cards.

STARTCHEESE
1234567

Bug hunt! Mia wanted the mouse to go 2 squares forward to the cheese. Her code was:   ↑   ↷   ↑. Circle the bug. What should it be?

In Puzzle 2, where is the cheese? (circle: above / below / beside)

Show answer key (for teachers)

Answer Key & Teacher Notes

Puzzle 1

↑ ↑ ↑ ↷ ↑ ↑ (forward 3, turn right, forward 2). Another correct answer: ↷ ↑ ↑ ↶ ↑ ↑ ↑ (turn right, forward 2, turn left, forward 3).

Puzzle 2

↑ ↷ ↑ ↑ ↑ ↷ ↑ (forward 1, turn right, forward 3, turn right, forward 1).

Bug hunt

The turn (↷) is the bug. Correct code: ↑ ↑. In Puzzle 2, the cheese is beside the mouse.

Teacher notes

  • Remind students to clear the old program before entering a new one, or the mouse will run both.
  • Turning does not move the mouse to a new square. This is a common bug.

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: Common Core State Standards © NGA Center/CCSSO; CSTA K-12 CS Standards © CSTA.