Stages 0 · 1 · 2 · 3 · 4
Computing
Break it into exact steps, let loops do the repeating, and hunt the bug calmly.
Seeds
CS-1
Break a big job into small steps
CS-2
Hand repeated work to a loop
CS-3
Any information can become numbers
CS-4
Mistakes are normal — find them
Stages
0
1
Observe and Say
How does the robot get there?
- Tell the robot exactly what to do A program is a list of exact steps run in order; when the same steps repeat, a loop says them once. Try it
- Find the bug To find a bug, run one step at a time and compare what happens with what you expected. Try it
- Send a picture with a few numbers A black-and-white picture can be sent as counts of same-colour squares in a row, so a picture with long runs needs far fewer numbers and still comes back exactly the same. Try it
2
Models and Patterns
How can we write fewer commands?
- Draw shapes with loops A regular shape with n sides is 'forward, turn 360°/n' repeated n times. Try it
- A picture is a grid of numbers A screen picture is a grid of pixels, and each pixel's colour is three numbers: red, green, blue. Try it
- A robot that checks for walls With 'if there is a wall ahead, turn; otherwise go forward' inside a loop, one short program can get through many different mazes it has never seen. Try it
- The card-flip trick: catching an error Add one extra card to every row and column so each has an even number of black sides; then a single flipped card shows up as the one odd row crossing the one odd column. Try it
3
Structure and Evidence
How do we make a program smarter?
- Counting with only 0 and 1 In binary each place is worth twice the place to its right, so any whole number is a sum of 1, 2, 4, 8, …. Try it
- The sorting race Different step-by-step methods give the same sorted list but need very different numbers of comparisons. Try it
- Variables are labelled boxes A variable is a named box that holds one value at a time; putting a new value in throws the old one away, so swapping two boxes needs a third. Try it
4
Systems and Argument
Is this algorithm fast enough?
- Halve it: how search gets fast Halving a sorted list each time finds one item among a million in about 20 looks. Try it
- One artificial neuron learns to sort A neuron multiplies each input by a weight, adds them up and says 'yes' if the total passes a threshold, so it splits the plane with a straight line; learning is nudging the weights after every mistake. Try it
Ideas we expect to meet
- The computer knows what you mean.
- The order of the commands doesn't matter.
- A program with a bug means you are bad at coding.
- A computer stores a picture as a picture, not as numbers.
- A faster computer always beats a better algorithm.