Part I · Chapter 1

Talking in the Dark

Before there were glowing screens or humming machines, there was a much older puzzle: how do you share a thought across a quiet street when nobody is allowed to make a sound?

Imagine it is late at night. The streetlights are off, the houses are asleep, and you are wide awake in your bedroom. Directly across the narrow street sits your friend Maya’s bedroom window. You just thought of something important to tell her, but opening the window to shout would wake the entire block. Waving your arms is useless in the dark.

Then you remember the flashlight sitting on your nightstand. You click it on and point it across the street. A warm yellow rectangle blooms in Maya’s dark window, and a moment later, a light blinks back from her room. You have her attention.

Now comes the real puzzle: how do you turn simple blinks of light into actual words?

Why Two Clear Choices Beat a Dozen Blurry Ones

At first, you might think of using brightness. Maybe a faint glow could mean A, a slightly brighter glow could mean B, and a dazzling beam could mean Z. Try that on a foggy evening, though, and everything falls apart. Through rain, mist, or a dusty windowpane, “medium bright” looks almost identical to “a little dimmer.” Worse, as your batteries slowly fade, every letter shifts into the wrong one.

Instead, look at what a flashlight does effortlessly: it is either on or off. Even through thick fog, even from a hilltop miles away, you can tell the difference between a shining bulb and a dark window. There is no guesswork in the middle.

The First Big Idea

When you want a message to survive distance, weather, and tired eyes, keep the signal simple. Two unmistakable states—light and dark—are far more trustworthy than twenty subtle shades of gray.

To turn a single light into an alphabet, you and Maya make a shared agreement before bedtime. A quick blink—just a tap of the thumb—will be a short flash (a dot). Holding the beam steady for a moment longer will be a long flash (a dash). A brief pause of darkness separates one letter from the next.

Try sending a message across the street yourself. Click the flash buttons below—or send one of the preset words—and watch the pulses travel from your window to Maya’s.

Interactive Lab 1 The Window Flashlight

Send short flashes (·) and long flashes (—) across the night street, then finish each letter to spell a message.

YOUR WINDOW MAYA’S WINDOW
Current Letter Flashes —
Matches Letter ?
Maya’s Decoded Message …
Tip: Try clicking Short · four times and then Finish Letter to send H, or click Send “HI” to watch the flashes fly across the street automatically.
Quiet footnote: You just reinvented Morse code, created in the 1830s to send words over long telegraph wires. And the trick of sticking strictly to two clear states (on and off) instead of smoothly varying brightness is what engineers call a digital signal.

How Two Choices Branch Into a Whole Alphabet

Wait a second. If your flashlight can only send two kinds of flashes—short or long—how can it possibly cover twenty-six different letters without getting hopelessly tangled up?

Picture yourself standing at the entrance to a garden maze. Every time Maya sends a flash, the path in front of you splits cleanly in two. A short flash tells you to step down the left path. A long flash tells you to step down the right path.

After just one flash, you can land on two different letters: E on the left, or T on the right. Notice that these are two of the most common letters in English, so you barely have to move at all to send them!

If a second flash arrives before the pause, each of those two paths forks in two again, opening up four fresh letters. A third flash splits each of those into eight more. Just by making two simple choices over and over, a tiny starting point blossoms into enough destinations for every letter in the alphabet.

Interactive Lab 2 The Forking Path Tree

Step left for a short flash (·) or right for a long flash (—) to walk down the tree—or click any letter directly to reveal its path.

Word: —
You are at the top of the tree (Start). Choose Short (·) to branch left or Long (—) to branch right.

Look closely at what happened in that garden tree. Nowhere did we invent a special, complicated symbol for R or K. We simply combined the same two humble moves—left and right, short and long—in a sequence. That is the quiet magic of a code: an agreement that turns simple physical events into meaning.

Quiet footnote: This branching map—where every spot splits into at most two next choices—is called a binary tree. You will meet trees like this again later in the book when we explore how machines organize and search information at lightning speed.

Of course, flashing a light across the street only works while both friends are awake and watching the window. What if we want a wire to react on its own—to combine two signals and make a tiny decision without anyone standing there? For that, we need to look inside the flashlight and meet the humble switch.

What You Just Built