Iffy chapter opener illustration

Iffy

THE CONDITIONAL - *a conditional lets a program DECIDE: 'IF this is true, THEN do that' - so the code can act one way when a condition holds and another way when it doesn't, instead of blindly doing the same thing no matter what.*

Iffy the Owl and the Locked Door

Iffy is a solemn, round-eyed owl who perches by the door at the end of the quest, and Iffy has exactly one question, asked at exactly the right moment. Iffy is the decider.

The door is locked. To open it, the hero needs a key - at least one. Now, a program with no way to decide would be in trouble here. It would have to either always open the door (letting a keyless hero stroll through, which breaks the whole puzzle) or never open it (trapping even a hero who did find the key). Neither is any good. What the program needs is the power to choose - to do one thing in one case and a different thing in another. That power is Iffy’s.

“I don’t just open the door,” Iffy says, blinking slowly. “And I don’t just keep it shut. I check first.” Iffy turns to Remma’s keys pocket and asks the question that shapes everything: “IF keys is at least 1, THEN open the door.” If the pocket holds 1 or more - the condition is true - Iffy opens it. If the pocket holds 0 - the condition is false - Iffy leaves it locked. Same door, same code, but the outcome depends on the situation.

That is a conditional, and it’s how a program stops being a blind list of steps and starts making decisions. The shape is “IF something is true, THEN do this.” The “if” part is a question with a yes-or-no answer - is keys at least 1? - and the “then” part only happens on a yes. It’s the difference between a machine that does the exact same thing no matter what, and one that looks at how things actually are and responds.

The order matters, and Iffy is proud of it: check first, act second. “I never fling the door open and hope a key turns up,” Iffy says. “I ask the question, I get my answer, and then I act on it. Checking before doing - that’s not being slow. That’s being right.” A program that acts first and checks later has usually already made its mistake.

And conditionals are everywhere in code, because deciding is everywhere in life. IF the hero touches a spike, THEN lose a life. IF the score reaches ten, THEN win. IF the timer hits zero, THEN stop. Each one is Iffy’s shape: a condition, checked, and an action that only runs when the answer is yes.

That is Iffy’s wise, careful idea.

IF the condition is true, THEN do the action - otherwise, don’t. Check first, then act.

A grown-up can play too! Listen for “if-then” decisions in an ordinary day - they’re constant once you notice. IF it’s cold, THEN wear a coat. IF the light’s red, THEN stop. IF the milk smells off, THEN don’t drink it. Each is a condition checked and an action chosen. That “if-then” is exactly how Iffy - and every program - makes a decision instead of blundering ahead.

When the hero arrives at the door with a key in Remma’s pocket and Iffy checks - keys is 1, that’s at least 1, condition true - the owl swings the door wide with a satisfied hoot. “Asked the question. Got a yes. Opened it,” Iffy says. “That’s not luck. That’s deciding.”

Check the condition, then decide. That’s Iffy.

The scriptquest ensemble

Iffy is part of scriptquest's distributed-narrative cast. Each character embodies a different curricular primitive; together they teach the full subject.