Skip to content
Your progress

Checking your sign-in…

Who's learning?

Each profile keeps its own read lessons, badges, streak, and practice scores on this device.

Lesson 3 of 9

Algorithm = exact steps, in order

Show on a big screen

5 min

Text size

You tell a friend the way to your house. You say exact steps, in order.

Loading lab…

That list of steps is an algorithm.

Step 1: move right.
Step 1 of 5
  1. Step 1: move right.
  2. Step 2: move right.
  3. Step 3: move down.
  4. Step 4: move down.
  5. Step 5: move down. The parcel reaches the gate.

An algorithm is an exact list of steps, in order.

Order matters

Socks, then shoes: easy. Shoes, then socks: it fails.

A grid is rows and columns of squares. A move past its edge does nothing. Start at the top-left corner.

  1. Up, down, right. "Up" has no square above, so nothing happens. "Down" moves one down. "Right" moves one right. You end one down and one right.
  2. Down, up, right. "Down" moves one down. "Up" moves back to the top. "Right" moves one right. You end one right.

Same steps. A different order gives a different place.

Try the lab to finish this lesson.