A program is a set of instructions that tells a computer what to do. The computer follows them one at a time, in order, from top to bottom.
Commands, sprites and blocks
A command is one small instruction, like "move forward" or "turn right". A row of commands in order is a sequence. In block coding (like Scratch), a sprite is a character or picture on screen, and a block is a coloured brick with a command written on it. You drag blocks and snap them together, like clicking bricks into a tower. The blocks stay stacked in the order you placed them, and that order is exactly the order the sprite will follow.
Starting with an event
An event is something that happens, like a click. The when green flag clicked block is a start event. It means: "Do not do anything yet. Wait until the flag is clicked, then begin."
Put this cat-sprite program in order:
- Click the green flag
- Sprite moves 10 steps
- Sprite says "Hello!"
Order changes what happens
If you swap the blocks around, you can get a different result.
| Order A | Order B |
|---|---|
| say "Ready?" move 10 steps | move 10 steps say "Ready?" |
| Speaks first, then moves. | Moves first, then speaks. |
Same blocks, different order, different program. That is why coders check the order carefully, testing their program to make sure the blocks run in the order they actually meant.