Lesson 1 · Coordinates on the Grid
Lesson 1 · Coordinates on the Grid
Teacher mode is on. Toggle it off (bottom-right) to preview the student view.
To tell the robot where to go, you need a way to name every spot on the grid. This lesson builds that system — (row, column) coordinates — with paper and the physical grid, no code yet. A solid mental model here makes tuples, lists, and the Manhattan algorithm click later.
Learning Objectives
By the end of this lesson you will be able to:
- Explain what a coordinate system is and why a robot needs one
- Name any intersection with a
(row, column)pair - Tell row (down) from column (right), and remember order matters
- Count the steps between two positions (the Manhattan distance)
Two numbers name any spot
You already know coordinate systems: Battleship ("B4"), chess ("e5"), a spreadsheet cell ("A1"), GPS latitude and longitude. Two numbers are enough to pinpoint any spot on a flat surface. Our grid uses the convention (row, column):
- The row (first number) is how far down from the top — the top row is row
0. - The column (second number) is how far right from the left — the left column is column
0.
Two things to burn in: we count from zero (the top-left is (0, 0), not
(1, 1)), and order matters — (2, 3) and (3, 2) are different spots.
In the coordinate (2, 3), what does the 2 mean?
Are (2, 3) and (3, 2) the same position?
Counting steps: Manhattan distance
Since the robot follows lines (no diagonals), the distance between two spots is just the row steps plus the column steps:
steps = (row difference) + (column difference)
From (0, 0) to (2, 3): 2 rows down + 3 columns right = 5 steps. This "blocks
you'd walk" total is called the Manhattan distance — named for walking a city
grid where you can't cut through buildings.
How many steps from (0, 0) to (3, 2), moving only along grid lines?
Activity · Map it
Grab a blank grid and label every intersection with its (row, col). Check yourself:
the bottom-right of a 4×4 grid should be (3, 3). Then answer a few:
- What's the bottom-left corner's coordinate?
- If the robot is at
(2, 1), what's directly above it? Directly left? - From
(1, 1)to(3, 0): how many rows, how many columns, how many total steps?
The robot is at (1, 2). What position is directly below it (one row down)?
Real-world connections
Grid coordinates run a surprising amount of the world:
GPS & maps
Latitude and longitude are just two numbers naming any spot on Earth.
Street grids
"5th Ave and 42nd St" is a coordinate — the reason this is called Manhattan distance.
Screens & spreadsheets
Every pixel and every cell is addressed by a row/column pair, counted from zero.
Wrap-up
- Which number comes first, and what does it mean? (Row — how far down.)
- Why start counting at 0? (To match how Python indexes, avoiding confusion later.)
- How do you find the number of steps between two spots? (Row difference + column difference.)