In this lesson
- It starts with a question. A till is told: "if the total is over $50, take 10% off." The total is $50 exactly. What happens?
- The idea you will find. A condition is a question with a yes or no answer. — The machine asks the question, then runs one branch or the other. Nothing in between. The craft is in choosing the boundary — over or at least, before or on — because the machine will apply whichever you wrote, every time, without judgement.
- Length. 5 short steps. Progress saves on this phone.
Part of Think Like a Program
Before any language: order, repetition and conditions, written so a machine cannot misread them.