A Computer Science Lesson Plan Template for Finding the First Wrong Step

A student moves a token to the wrong square. “Try again” may produce a correct ending without showing whether the student understood the instructions. Ask the student to record the square after each command instead.

That gives you a place to locate the error and a way to test a correction.

This 30-minute unplugged lesson uses a nine-square grid, a token, and three command cards. Learners execute a sequence, compare its trace with an intended path, replace one command, and explain what changed. You can teach it with paper materials before considering an optional screen demonstration.

Trace the First Wrong Step — Have learners execute an exact ordered command sequence, record each state, identify the first divergence and test a correction against a…
Trace the First Wrong Step — Have learners execute an exact ordered command sequence, record each state, identify the first divergence and test a correction against a…
Open the full example ↗

Old Dominion University's computer science integration resource connects analyzing and correcting algorithms with explicit lesson objectives and evidence of student actions. Its planning materials also distinguish teacher behavior, learner behavior, and evaluation. The grid, command sequences, timing, and answer key below are original examples; this lesson does not claim complete alignment with a state standard. ODU's Computer Science Lesson Integration resource

Fix the map before giving instructions

Make a 3×3 grid with coordinates from 0 through 2 on both axes. Put (0,0) at the bottom left. Moving east increases x by one; moving north increases y by one. Label the start (0,0) and goal (2,1). Define E as one square east and N as one square north. A command changes one coordinate, not the token's facing direction.

Give each pair a grid, token, E and N cards, and a recording sheet with columns for command number, command, and resulting coordinate. The student objective is: “I can follow an ordered sequence, record each position, find the first difference from an intended trace, and test a one-command correction.”

Command number Intended sequence Intended position Buggy sequence Buggy position
Start — (0,0) — (0,0)
1 E (1,0) E (1,0)
2 E (2,0) N (1,1)
3 N (2,1) N (1,2)

Both sequences make a valid first move. Their first divergence is command 2. Replacing the buggy sequence's second N with E gives E,E,N, reaches the supplied goal, and reproduces the intended trace. Adding an extra command would miss the point of this particular one-command correction task.

Use the 30 minutes to produce evidence

During the first four minutes, learners locate the origin, start, and goal and rehearse E and N. Ask one student to point to (1,0) and another to (0,1). Resolve axis confusion before tracing.

Use five minutes to model E,E,N. Move once, pause, and record the new coordinate after every command. Say “This is the position after command 2” while writing (2,0). Leave that intended trace visible.

Give pairs eight minutes to execute E,N,N. One learner reads the cards while the other moves and records; then they explain the trace together. Do not let the mover head directly toward the goal. The token follows the cards as written, even when the path is wrong for the task.

Spend seven minutes debugging. Ask, “What is the first numbered row where the coordinates differ?” After learners identify command 2, have them replace only that command, return the token to the start, and record all three corrected positions. Accept the correction when the replay supports it. Keep actual observations blank in the plan until the lesson happens.

For a four-minute individual check, use the original new sequence N,E,E, with the same start and goal. Its positions are (0,1), (1,1), and (2,1). It reaches the goal by a different path. Ask learners to record the trace and explain why reaching the same goal does not make its intermediate positions identical to E,E,N.

Use the final two minutes for reflection: “Which row helped you find the bug, and what did the replay show?” The six parts total 30 minutes. Keep the model, partner debug task, and individual check distinct in the teacher key.

Decide what an invalid move does

If a command would take x or y outside 0–2, stop at the last valid position and identify the invalid command number. Do not wrap the token to another edge or silently skip the command. For example, E,E,E stops before command 3 can move the token out of the grid; the last valid position is (2,0).

Offer larger labeled squares, spoken commands, or a partner who moves the token while the learner directs and explains. Preserve the same ordered-state task. Provide the teacher key separately from the learner recording sheet so an answer does not become the student's supposed observation.

Copy this prompt to prepare the lesson materials

Create one complete, self-contained US-English HTML companion for “Trace the First Wrong Step”. Return the full HTML document, with inline CSS and any JavaScript needed for the local interactions. Use the original scenario, named records, numbers and expected cases below.

Design the page for this task: use clearly labeled input or source records, a readable result or worked example, and an adjacent explanation of the evidence. Use a restrained visual hierarchy, left-aligned text, readable tables or stacked records, and a responsive layout at 720px and 360px. Provide meaningful labeled controls for Step one command; Run remaining commands; Reset trace; Apply the one-command correction; Restore E,N,N; Load E,E,N model; Load N,E,E check; Load E,E,E boundary case; Restore 30-minute timing; Select learner sheet. Use keyboard-accessible native controls and visible focus. Keep the complete content readable without an external dependency.

The following brief supplies the substantive content and constraints. Native-format requests describe the material to represent or copy manually; this HTML must not pretend to create DOCX, XLSX, PDF, PPTX, H5P or another native file, run Python/Flask/Django/Snowflake/Power BI, connect a live service, send messages, or perform an authorized real-world action. Where the task requires a native source, actual observation or separate approval, retain that requirement and leave unsupplied evidence blank.

Write a complete US English 30-minute unplugged computer science lesson with a teacher plan, learner recording sheet and separate teacher key. Do not invent classroom results or claim state-standard alignment.

Use a 3x3 grid: x,y each0..2, origin(0,0) bottom-left; east increasesx, north increasesy. Start(0,0), goal(2,1). E moves one square east; N moves one square north. No facing-direction rules. Objective: execute an ordered sequence, record each resulting coordinate, identify first divergence from an intended trace, replace one command and test it. Model E,E,N -> (1,0),(2,0),(2,1). Partner bug E,N,N -> (1,0),(1,1),(1,2). First divergence command2; replace only that N withE, reset to start and replay E,E,N. Do not add a command or alter the goal. Individual check N,E,E -> (0,1),(1,1),(2,1). Explain same goal/different intermediate path. Boundary example E,E,E: stop before invalid command3, last valid(2,0), no wrap or skip.

Allocate4minutes setup,5 model,8 partner trace,7 debug,4 individual check,2 reflection. Include materials, precise teacher questions and learner actions, coordinate/axis supports, and blank actual-evidence fields. Keep keys out of the learner sheet. If proposing an optional HTML demonstration, specify stepwise state/trace visibility, expected-versus-buggy comparison, one-command correction and reset clearing the trace/feedback. Include text controls usable without dragging. Mark implementation/testing pending; do not claim robot control, saved learner results or automatic mastery grading.

COMPLETE AUTHORED SCENARIO AND EXPECTED CASES
The following is the supplied reading/teaching/calculation record to represent in the companion. Preserve its particular content, examples, source references and unknowns. Wording about a future native implementation refers to that native task, not permission to omit this HTML companion.

# A Computer Science Lesson Plan Template for Finding the First Wrong Step

A student moves a token to the wrong square. “Try again” may produce a correct ending without showing whether the student understood the instructions. Ask the student to record the square after each command instead. That gives you a place to locate the error and a way to test a correction.

This 30-minute unplugged lesson uses a nine-square grid, a token, and three command cards. Learners execute a sequence, compare its trace with an intended path, replace one command, and explain what changed. You can teach it with paper materials before considering an optional screen demonstration.

Old Dominion University's computer science integration resource connects analyzing and correcting algorithms with explicit lesson objectives and evidence of student actions. Its planning materials also distinguish teacher behavior, learner behavior, and evaluation. The grid, command sequences, timing, and answer key below are original examples; this lesson does not claim complete alignment with a state standard. [ODU's Computer Science Lesson Integration resource](https://www.odu.edu/sites/default/files/2025/documents/main-csli-final.pdf)

## Fix the map before giving instructions

Make a 3×3 grid with coordinates from 0 through 2 on both axes. Put `(0,0)` at the bottom left. Moving east increases x by one; moving north increases y by one. Label the start `(0,0)` and goal `(2,1)`. Define `E` as one square east and `N` as one square north. A command changes one coordinate, not the token's facing direction.

Give each pair a grid, token, E and N cards, and a recording sheet with columns for command number, command, and resulting coordinate. The student objective is: “I can follow an ordered sequence, record each position, find the first difference from an intended trace, and test a one-command correction.”

| Command number | Intended sequence | Intended position | Buggy sequence | Buggy position |
| --- | --- | --- | --- | --- |
| Start | — | (0,0) | — | (0,0) |
| 1 | E | (1,0) | E | (1,0) |
| 2 | E | (2,0) | N | (1,1) |
| 3 | N | (2,1) | N | (1,2) |

Both sequences make a valid first move. Their first divergence is command 2. Replacing the buggy sequence's second N with E gives `E,E,N`, reaches the supplied goal, and reproduces the intended trace. Adding an extra command would miss the point of this particular one-command correction task.

## Use the 30 minutes to produce evidence

During the first four minutes, learners locate the origin, start, and goal and rehearse E and N. Ask one student to point to `(1,0)` and another to `(0,1)`. Resolve axis confusion before tracing.

Use five minutes to model `E,E,N`. Move once, pause, and record the new coordinate after every command. Say “This is the position after command 2” while writing `(2,0)`. Leave that intended trace visible.

Give pairs eight minutes to execute `E,N,N`. One learner reads the cards while the other moves and records; then they explain the trace together. Do not let the mover head directly toward the goal. The token follows the cards as written, even when the path is wrong for the task.

Spend seven minutes debugging. Ask, “What is the first numbered row where the coordinates differ?” After learners identify command 2, have them replace only that command, return the token to the start, and record all three corrected positions. Accept the correction when the replay supports it. Keep actual observations blank in the plan until the lesson happens.

For a four-minute individual check, use the original new sequence `N,E,E`, with the same start and goal. Its positions are `(0,1)`, `(1,1)`, and `(2,1)`. It reaches the goal by a different path. Ask learners to record the trace and explain why reaching the same goal does not make its intermediate positions identical to `E,E,N`.

Use the final two minutes for reflection: “Which row helped you find the bug, and what did the replay show?” The six parts total 30 minutes. Keep the model, partner debug task, and individual check distinct in the teacher key.

## Decide what an invalid move does

If a command would take x or y outside 0–2, stop at the last valid position and identify the invalid command number. Do not wrap the token to another edge or silently skip the command. For example, `E,E,E` stops before command 3 can move the token out of the grid; the last valid position is `(2,0)`.

Offer larger labeled squares, spoken commands, or a partner who moves the token while the learner directs and explains. Preserve the same ordered-state task. Provide the teacher key separately from the learner recording sheet so an answer does not become the student's supposed observation.



Implement the local companion rather than returning a text-only plan. Preserve every numerical fixture and the distinction between illustrative expectations and actual evidence. Any native-runtime or classroom tests mentioned above remain tests to perform in the proper environment; do not mark them passed. Keep edits and practice responses in this open page only, without claiming persistent storage. Provide invalid/missing-input feedback and reset behavior that agree with this specific brief. Do not claim accessibility certification, learning gains, real approvals or test results that were not observed.

Review the planned trace

When using the companion’s step control, check that each click changes only the defined state and that reset restores (0,0) and clears the trace and feedback. The paper lesson remains usable on its own, and actual student evidence belongs in your teaching records.

Explore NOS

Before teaching, have a colleague follow the buggy cards exactly and name command 2 as the first divergence; after teaching, use learners' recorded traces to decide what needs another explanation.

Keep reading