lesson

Updated 1 month ago · 6 views
Imagine you have a friendly robot puppy that wants to reach a tasty bone across the room. How can you tell the puppy exactly where to walk?
We can draw a map made of square tiles called a grid, and use arrows to show each step.
📊Interactive diagram
Every arrow is a single command: one arrow moves the character one square in that direction.
What happens when we string several arrows together to make a full path?
Building a Sequence
An ordered list of steps to solve a problem is called an algorithm or a sequence.
To guide our puppy to the bone, we read the arrows from left to right, one by one.
📊Interactive diagram
The sequence Right, Right, Down, Down moves the puppy four times to reach the bone safely.
A common mistake is counting the starting square as your first move. Remember: you only count a move when you step into a new square!
What if a big mud puddle is blocking the path?