If this, then that: simple choices

Computer Science · Early Years · The School

A simple kind of rule

Here is a useful shape for a rule. "IF something happens, THEN do this." If it is cold, then wear a coat. The rule has two parts. The IF part notices something. The THEN part decides what to do about it.

Trying it with real situations

If the traffic light is red, then stop. If it starts raining, then take an umbrella. If you feel hungry, then eat something. Each rule covers one situation completely, with one clear answer already built in.

Quick decisions

You do not need to think hard every single time. The rule already decided for you, in advance. See the red light, and you already know what to do. That is what makes "if this, then that" so useful and so fast.

IF it is cold outside, THEN wear a coat. You check, it is cold, so on goes the coat — no long thinking needed. IF you feel hungry, THEN eat breakfast. You do feel hungry, so you eat. IF the traffic light is red, THEN stop. It turns red, so you stop, instantly. Three separate "if this, then that" rules, used one after another, each one giving an instant answer, with no need to work anything out from scratch.

The School — all subjects · Knowledge map