Step-by-Step Instructions
An algorithm is a set of step-by-step instructions that solves a problem or completes a task. You use algorithms every day without knowing it!
Think about tying your shoes:
- Cross the laces
- Pull one under the other and tighten
- Make a loop with one lace
- Wrap the other around it
- Pull through and tighten
If you did step 3 before step 2, it wouldn't work. Order matters!
⭐
Fun Fact!
The word "algorithm" is over 1,000 years old. It comes from Al-Khwarizmi, a Persian mathematician whose books on math changed the world.
Computers Need Exact Instructions
Computers are incredibly fast — but they are not smart on their own. They do exactly what they are told, nothing more and nothing less.
If you tell the turtle to move forward 60 steps, it moves exactly 60 steps. If you forget to tell it to turn, it will never turn — even if turning would make more sense to you!
💡
Think About It
If you were a robot told to "make a sandwich," what questions would you need answered first? Where is the bread? What goes on it? Computers need that same level of detail.
Meet the Turtle 🐢
In this course you will give instructions to a turtle — a glowing triangle that moves around a canvas on your screen. The turtle understands these commands:
- ⬆ Move Forward — turtle travels forward by a number of steps you choose
- ⬇ Move Backward — turtle travels backward
- ↖ Turn Left 90° — turtle rotates a quarter-turn to the left
- ↗ Turn Right 90° — turtle rotates a quarter-turn to the right
The turtle starts in the center of the canvas, facing right. Build a program, then click Run to watch it go!