Skip to main content

Lesson 1 · Coordinates on the Grid

Module 4 · Manhattan Navigation

Lesson 1 · Coordinates on the Grid

40–50 minNo codingMental model first
👩‍🏫

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.
🖼️
Labeled 4×4 grid: every intersection marked with its (row, col), top-left = (0,0)
Add a src to drop in your image
Row first, column second. Top-left is (0, 0) — we count from zero.

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.

Knowledge Check

In the coordinate (2, 3), what does the 2 mean?

Knowledge Check

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.

Knowledge Check

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?
Knowledge Check

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:

Navigation

GPS & maps

Latitude and longitude are just two numbers naming any spot on Earth.

Cities

Street grids

"5th Ave and 42nd St" is a coordinate — the reason this is called Manhattan distance.

Computers

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.)

Resources