lesson

Updated 6 days ago ยท 2 views
Imagine you have a friendly toy robot and you tell it, "Make me a sandwich!"
The robot just blinks its eyes and stands still because computers cannot guess what you want.
To get a computer or robot to do anything, we must give it clear steps called instructions.
An instruction is a single, clear action or command, such as Step Forward or Turn Left.
An instruction is a single, clear action or command, such as Step Forward or Turn Left.
What happens when we put these steps in a line?
Steps in Order
When you arrange instructions in an exact order, you make a sequence.
Think about getting dressed: you put on your socks first, and then your shoes.
๐Interactive diagram
If you swap the order and put your shoes on before your socks, it does not work!
Computers work the exact same way โ they do step one, then step two, then step three.
How do we tell a robot where to walk using a sequence?