Before any language, any compiler, any code: a computer has no judgment and fills in no gaps. Once you have felt that, half of programming stops being mysterious.
A computer does exactly what you told it to do — not what you meant, not what any reasonable person would have assumed, and it will never stop to ask.
This sounds obvious until it happens to you. Every human you have ever given instructions to filled in the gaps for you. Say “grab me a coffee” and a person works out the cup, the route, the door, the money. None of that was in what you said. They supplied it.
A computer supplies nothing. If you leave a gap, it walks straight into the gap — confidently, at full speed, without a flicker of doubt. Almost every bug you will write this semester is a gap you did not know you left.
A list of steps precise enough that something with no judgment can follow it is called an algorithm. That is the entire word. It is not a maths thing, and it does not need a computer — a recipe is an algorithm, and so are the steps for tying a shoe.
The robot is at the bottom-left and it is facing right. The coffee is top-right. There is a wall in the way. Build a list of steps, then press run and watch it obey you literally.
Click steps to add them. Click a step in your program to delete it. Then press run.
Notice what it did not do. It did not stop at the wall. It did not say “are you sure?” It did not go round. You said forward, so it went forward, into a wall, because going into the wall is what you asked for. That is not the robot being stupid. That is the robot being exact.
Your course description says the emphasis is on “problem analysis and on the subsequent development of algorithms” and that the major focus of the lectures is “top-down software design.” Read that again. It does not say the emphasis is on C++.
C++ is just the language you will write the steps down in, the way English is the language you would write a recipe in. Knowing lots of English does not make you a cook. Most people who struggle in this course study the language and never practise the thinking — then an exam hands them a problem in plain words and they have nowhere to start.
You are doing it in the right order. Six levels of thinking first, no code, no compiler. Then the language, which is the easy half.
Write down the steps to make a peanut butter sandwich. Hand the paper over. From that moment you may not speak, gesture, or help.
Do exactly what is written. Nothing more. “Put peanut butter on the bread” means the jar goes on the loaf — closed, in its jar, on top of the bag.
Swap roles and do it again with a different task. The point lands in about ninety seconds and it never really leaves you: the instructions felt complete when you wrote them. They were not. That feeling — “but obviously I meant…” — is exactly what a compiler error feels like.
Not what you meant. When something goes wrong, the machine is almost never the thing that is wrong.
No maths required. If something with zero judgment could follow it, it is an algorithm.
You cannot see your own assumptions. That is why you test, and why you have someone follow your steps literally.
Not recall — these are the shapes an exam actually uses. Every answer below was produced by compiling and running the code, so if you disagree with one, the compiler is the one to believe.
Have a real go before revealing. Being wrong here is worth more than being right in three weeks.
Your instructions say “go forward” three times. There is a wall after two steps. What does the machine do?
What is an algorithm?
You give someone instructions and they do something absurd. Whose mistake is it, usually?
← back to all 12 levels · stuck on anything? ask peter.