Putting It All Together: The Full Picture You have learned three ideas across this series: 1. Sequence — Instructions happen in a specific order, one at a time 2. Decision — The computer checks a condition and chooses what to do 3. Loop — A set of steps repeats until a condition is met These are not three separate things. They work together, inside every program ever written, in every language, on every device. This post brings them together with one example you now know well: the traffic signal. The Complete Traffic Signal Let's trace through how a real traffic signal works using all three ideas. The Loop: It Never Stops A traffic signal does not run once and stop. It runs all day, every day. That is a loop: > Keep cycling through the light sequence forever (or until switched off) Everything else happens inside this loop. The Sequence: The Order of Lights Inside the loop, the lights follow a fixed sequence — a specific order that must not change: 1. Red light on → wait 30 seconds 2. Yellow light on → wait 3 seconds 3. Green light on → wait 25 seconds 4. Yellow light on → wait 3 seconds 5. Back to the beginning This is a sequence of steps performed one at a time, in order. The Decision: Responding to the Real World A smart traffic signal does not just mindlessly cycle. It also makes decisions: If an emergency vehicle (ambulance, fire engine) is approaching, then hold the green light longer and stop the normal cycle Otherwise , continue the regular sequence Or at night-time: If it is past midnight and there are no vehicles detected, then just blink yellow (caution mode) Otherwise , run the full red-yellow-green sequence These are decisions layered on top of the sequence, inside the loop. The Three Ideas Together: Visualised Here is the complete picture of the traffic signal program in plain language: Start the loop (run this forever) > > Decision: Is it midnight with no vehicles? > If yes: blink yellow light and skip the rest > > If no, follow the sequence: > Step 1: Red light on, wait 30 seconds > Step 2: Yellow light on, wait 3 seconds > Step 3: Green light on, wait 25 seconds > Step 4: Yellow light on, wait 3 seconds > > Decision: Is an emergency vehicle approaching? > If yes: Hold green for extra 15 seconds End of loop, go back to the top A sequence, inside a loop, with decisions affecting what happens — this is exactly how real programs work. Every Program is These Three Ideas It sounds too simple. Surely a smartphone app or a video game is vastly more complex than a traffic signal? Yes — but only in scale , not in structure . A video game's main program loop: Loop (run 60 times per second): > Check what the player pressed (input — sequence) > Decision: Did they jump? Move the character up > Decision: Did they hit an enemy? Reduce health > Decision: Is health zero? End the game > Draw the updated screen (output — sequence) It runs 60 times per second instead of once every minute — but it is the same three ideas. A social media app, a music streaming service, a satellite guidance system — all of them, at their core, are sequences of instructions, decisions based on conditions, and loops that repeat until something stops them. What Comes Next? If you have followed this series from the beginning, you now have genuine foundations: You understand what computers do (input, process, output) You understand how computers follow instructions (sequence) You understand how computers respond to situations (decisions) You understand how computers repeat work efficiently (loops) One day you will write these instructions in a real language — Python, JavaScript, Scratch. They all give you sequences, decisions, and loops, just with different ways of writing them down. You already understand the thinking . The language is only the way you write it down. But before you get there, a few more thinking skills are worth collecting. You now know how a computer thinks . The next question is a different one: How do you actually talk to one? That is what the next series is about: Commands: How We Tell Computers What To Do. 🎯 Try This Yourself Design the Automatic Pet Feeder This is your first real design job. No computer needed — paper and pen only. The problem: your cat needs feeding twice a day, but nobody is home at lunchtime. Design the machine. 1. Start with the loop. What does the machine do over and over, forever? Write it as one line. 2. Write the sequence. When it is time to feed, what are the exact steps? Open the flap, drop 40 grams, close the flap, log the time — in order. 3. Add the de…