🤖 ➕ 📋

What Is An Algorithm?

An algorithm is just a list of steps, in the right order, that gets a job done.

You already use algorithms every day!

🥪 Making a sandwich 🦷 Brushing teeth 🚌 Taking bus 88 home ➗ Long division

A computer can't guess what you mean. So we must tell it every step — clearly, and in order.

👉 In this lesson you will give steps to a robot, spot a bug, and even sort numbers like a computer does. Tap Next to begin!

Every algorithm has steps 🪜

Here is the algorithm for washing your hands. Tap each step to see why the order matters.

Give the robot exact steps 🤖

Robo must reach the star ⭐. Add step-cards to build your program, then press Run. Robo does exactly what you say — nothing more!

Steps must be clear 🔍

A computer has no common sense. "Make it nice" means nothing to it. Compare these two:

❌ Too vague

1. Get some rice.
2. Cook it properly.
3. Serve nicely.

How much rice? How long? The robot freezes. 🥶

✅ Clear enough for a computer

1. Put 1 cup of rice in the pot.
2. Add 2 cups of water.
3. Cook for 15 minutes.
4. Turn off the heat.

Good algorithm steps answer: What? How much? How long? When do I stop?

Your turn: which step is clear enough for a computer?

Order changes everything 🔀

Same steps, wrong order = a mess! Use the ⬆️ ⬇️ buttons to fix this "put on shoes" algorithm, then press Check.

Hunting a bug 🐛

When an algorithm goes wrong, we say it has a bug. Fixing it is called debugging.

Here is the algorithm for drinking a packet drink. One step is in the wrong place. Tap the buggy step!

A real algorithm: sorting 📊

Computers sort things all the time — names, prices, scores. Here is Selection Sort: find the smallest, put it first, repeat.

Press "Do one step" to run the algorithm slowly.

🏆

You now know what an algorithm is!

📋 An algorithm is a list of steps that finishes a job.
🔀 Order matters — socks before shoes, straw before sipping.
🔍 Steps must be clear and exact — numbers beat "a while".
🐛 A wrong step is a bug; fixing it is debugging.
📊 Computers use algorithms for real jobs, like sorting numbers.
Try this at home: write the algorithm for making Milo 🥤 — every single step. Then read it to someone and make them follow it exactly. If they get it wrong… you found a bug!

Great thinking today. You're already thinking like a computer scientist! 🌟