← Library

The Logic League

The Changing Thing

The Changing Thing

Book 8 of The Logic League


  1. The Shifting Garden

The laptop's glow spilled across the lost-and-found closet like a question waiting to be answered. Priya opened it—of course she opened it—and the green text cascaded down the screen before curling into a doorway.

The kids stepped through into a place they'd never seen before.

The Entry Zone had always been orderly: straight paths, numbered doors, everything in its proper sequence. But this place was different. It looked like a garden made of light, with paths that curved and plants that grew from glowing stems. Except nothing stayed the same.

"Look at that flower," Kwame said, pointing.

A large blossom near the path was bright blue. As they watched, a small silver caterpillar crawled up its stem and touched a leaf.

The flower turned yellow.

"That's new," Lily said, her eyes narrowing.

Sam walked closer. "Did it just... change?"

"It changed because of the caterpillar," Priya said, already pacing. "Something happened, and then the flower changed. This is a sequence."

"Or a condition," Kwame offered. "IF caterpillar touches leaf, THEN flower turns yellow."

"Either way," Lily said, "we need to understand it before we move on."

A shimmering sign rose from the ground beside the path. The kids gathered around it.

WELCOME TO THE GARDEN OF CHANGING THINGS

NOTICE: Some things here are not fixed. They hold values that can change. Track them carefully, or you will lose your way.

"Oh, I don't like that," Sam said quietly.

"Values that can change," Priya repeated, tasting the words. "Like... the flower. Its color is a value. Right now it's yellow. But it wasn't always yellow."

Kwame pulled out his journal and started writing. "A thing that holds a value that can change," he murmured. "That's a—"

He stopped. The sign shimmered and added one more line:

THESE CHANGING THINGS ARE CALLED VARIABLES.

"Variables," Lily said, testing the word. "So the flower is a variable. Its color is the value, and the caterpillar changed it."

The sign flickered.

CORRECT. THE FLOWER IS A VARIABLE NAMED FLOWER_BLOOM. ITS VALUE IS CURRENTLY YELLOW.

Sam tilted their head. "It has a name? Like, a specific name?"

"Everything needs a name if you want to track it," Priya said. "If we just said 'that flower over there,' how would we know which one we meant? But if it's called flower_bloom, we always know exactly which flower we're talking about."

"That's why the sign told us the name," Kwame said, his eyes bright. "Names make things trackable."

They continued down the path, passing more flowers in different colors. Some were blue. Some were yellow. A few were purple.

None of them changed as the kids walked past.

"They're waiting for something," Lily observed. "For a specific event, probably. A trigger."

"Like the caterpillar," Sam said. "The caterpillar was a trigger."

The path curved, and they found themselves in a small clearing. In the center stood a door—alone, with no walls around it, just a door standing on the grass. Above it, a sign read:

THE DOOR WILL OPEN WHEN ITS CONDITION IS MET.

THE CONDITION DEPENDS ON A VARIABLE NAMED COUNTER.

COUNTER'S CURRENT VALUE: 0

"I don't see any instructions," Kwame said, walking around the door.

"Look!" Sam pointed at the ground near the door's base.

There was a small control panel with three buttons. The buttons were labeled:

BUTTON A: COUNTER = COUNTER + 1

BUTTON B: COUNTER = COUNTER + 2

BUTTON C: COUNTER = COUNTER - 1

"And underneath the buttons," Lily said, reading carefully, "it says: THE DOOR OPENS WHEN COUNTER EQUALS 5."

Priya grinned. "This is easy. We just need to make counter equal 5."

She pressed Button A twice. The sign above the door updated:

COUNTER'S CURRENT VALUE: 2

She pressed Button B once.

COUNTER'S CURRENT VALUE: 4

"One more A," she said, pressing it. The sign flickered.

COUNTER'S CURRENT VALUE: 5

The door swung open with a soft click.

"See?" Priya said. "We just had to track the variable and change it until it hit the right value."

Inside the doorway was a small room. But the far wall showed a puzzle they hadn't expected: a wall of flowers, each one with a name plaque beneath it, and a locked gate at the far end.

  1. The Wall of Names

The wall of flowers was beautiful and confusing. There were dozens of them, arranged in rows, each in its own small pot with a plaque.

But the flowers themselves were all gray.

"They're all the same color," Sam said. "That's weird. The garden outside had colored flowers."

Lily was already reading the plaques. "They're not the same. Look—they all have different names."

The plaques read:

GARDENIA_1: GRAY

GARDENIA_2: GRAY

GARDENIA_3: GRAY

GARDENIA_4: GRAY

GARDENIA_5: GRAY

And on and on, down the rows. More gardenias than they could count.

"All gray," Kwame said. "All named. What changes them?"

A new sign appeared on the wall beside them:

TO OPEN THE GATE, MAKE GARDENIA_1 BLUE.

THE COLOR OF A GARDENIA CHANGES WHEN IT IS WATERED.

THE WATERING CAN IS BEHIND YOU.

The kids turned. There, sitting on a small table behind them, was a watering can filled with glowing blue liquid.

"That's convenient," Priya said, grabbing the can. "We water GARDENIA_1, it turns blue, the gate opens. Simple."

She walked to the first flower and tipped the can. blue liquid splashed onto the gray petals.

Nothing happened.

The sign flickered.

ERROR: GARDENIA_1 DID NOT TURN BLUE BECAUSE THE VARIABLE NAMED CONTAINER WAS NOT TRACKED.

"Container?" Sam said. "What container?"

"Wait," Lily said, holding up a hand. "Think. The watering can—it has a variable too. What's its value? How much water is in it?"

Priya looked at the can. "I didn't check."

She peered inside. The can was still full.

"The water isn't the problem," she muttered.

The sign flickered again, adding a line:

THE WATERING CAN IS A VARIABLE NAMED WATER_LEVEL.

IT CURRENTLY HOLDS A VALUE. REDUCE IT TO 0 TO CHANGE A GARDENIA'S COLOR.

"Reduce it to zero?" Kwame said. "But we just used the water and it didn't reduce anything."

"Because we don't know how much we used," Lily said slowly. "We didn't track the starting value. We dumped water without checking the can's value first."

Priya looked at the can more carefully. There was a small gauge on the side.

WATER_LEVEL: 10

"Ten," she said. "It starts at ten. And when we water a flower..." She tipped the can over GARDENIA_1 again, but watched the gauge closely.

WATER_LEVEL: 9

"You used exactly one," Sam said. "One unit of water per flower."

"But it still didn't turn blue," Kwame said, frowning.

The sign flickered again:

ERROR: GARDENIA_1 REQUIRES WATER_LEVEL = 5 TO CHANGE FROM GRAY TO BLUE.

GARDENIA_1'S CURRENT VALUE: GRAY

"Wait," Lily said, her voice sharp. "It doesn't just need water. It needs a specific amount of water on it. The flower changes when the water—and the flower—are in the right state."

"I don't get it," Sam admitted.

Kwame's eyes lit up. "It's like a recipe! You don't just add water—you add the right amount of water. The flower is a variable that changes, but it only changes when the condition is right. IF water_level equals exactly 5, THEN gardenia_1 changes from gray to blue."

"But we only used one unit," Priya said. "Nine left. The flower needs five total."

"We used one," Lily said. "We need to use four more on the same flower."

Priya dumped more water on GARDENIA_1—once, twice, three times, four times. The gauge read:

WATER_LEVEL: 5

The flower shimmered, and the plaque changed:

GARDENIA_1: BLUE

The gate swung open.

"Oh," Sam said softly. "The flower was waiting for the right value. And we had to know both the water level and the flower's value to make it work."

"Exactly," Kwame said, writing in his journal. "Variables work in pairs—you have to track all of them to know when the condition is true."

  1. The Counting Bridge

Beyond the gate, the garden opened into a wide canyon. A bridge spanned it—but it was a strange bridge, made of glowing stepping stones that hovered in the air. On the near side, a sign read:

THE BRIDGE EXTENDS ONE STONE FOR EACH COMPLETE GARDENIA SET.

A COMPLETE SET REQUIRES ALL GARDENIA PLANTS TO BE THE SAME COLOR.

CURRENTLY, THE BRIDGE IS 1 STONE LONG.

"All the same color," Priya repeated. "All those gardenias are gray. So the bridge should already be one stone long."

"One stone isn't enough to cross anywhere," Sam pointed out.

"No bridge is long enough if the flowers stay gray," Kwame agreed. "We need to change them."

"But they're all gray!" Sam said. "They're already the same color!"

"Sam's right," Lily said. "Look at the wording. The complete set is all gardenias being the same color. They ARE all the same color—gray. So the bridge should extend."

The sign flickered.

ERROR: GRAY IS NOT THE TARGET VALUE. THE COMPLETE SET REQUIRES A NON-GRAY COLOR.

"Of course," Priya groaned. "Gray counts as the starting value. We have to change them all to something else."

"How much water do we have?" Kwame asked.

Lily checked the can. "Five units left. And there are ten gardenias."

"Let me think," Priya said, pacing. "Each gardenia takes five water units to change from gray to blue. We have five water units. That's enough for one flower."

"But we need to change all ten," Sam said.

"Not necessarily," Lily said slowly. "We need to change them all to the same color—any non-gray color. What if we don't water them all equally? What if we use different amounts?"

"That's not how it works," Priya said. "It takes exactly five to make them blue."

"That's how GARDENIA_1 worked," Kwame said. "But maybe different amounts make different colors. Maybe five water units makes blue, but four makes green, or three makes red."

The sign flickered helpfully:

DIFFERENT WATER LEVELS PRODUCE DIFFERENT COLORS.

WATER_LEVEL = 5: BLUE

WATER_LEVEL = 4: GREEN

WATER_LEVEL = 3: RED

WATER_LEVEL = 2: PURPLE

WATER_LEVEL = 1: ORANGE

"Five different colors," Sam said. "And we have five water units. We could make each flower a different color?"

"That would make them not the same color," Kwame pointed out.

"Unless we make all ten the same color," Lily said. "But we only have five water units, and each flower uses at least one. We can water ten flowers with one unit each—that makes them all orange!"

Priya stopped pacing. "Ten flowers. One water unit each. Five possible colors, but we can only do one unit per flower if we want to treat them all equally."

"All orange," Sam said. "They'd all be the same color. The complete set!"

Lily raised the can and walked along the row of gardenias, dumping one unit of water on each. The gauge dropped:

WATER_LEVEL: 4

WATER_LEVEL: 3

WATER_LEVEL: 2

WATER_LEVEL: 1

WATER_LEVEL: 0

After the tenth flower, every plaque read:

GARDENIA_10: ORANGE

The bridge rumbled and extended—ten glowing stones stretched across the canyon.

"Ten flowers, ten stones," Kwame said. "The number of stones matched the count of flowers in the set."

"The value of the variable," Priya said. "The bridge used the count of matching flowers to decide how long to make itself."

Sam was quiet for a moment. Then: "But how did the bridge know the flowers were all the same color? It had to check each one, right?"

Lily nodded. "It checked every gardenia's color value. IF all gardenias are orange, THEN extend bridge to 10 stones. It didn't even need to know how many flowers there were in advance—it just counted the ones that matched."

"Like a variable that changes based on conditions," Kwame said, writing furiously in his journal.

  1. The Final Door

The bridge crossed the canyon and ended at a door—the most ornate door they'd seen yet. It was covered in swirling patterns of blue, green, red, purple, and orange. At its center was a keyhole, and beside it, a screen that displayed:

THE DOOR REQUIRES A PASSWORD.

THE PASSWORD IS STORED IN A VARIABLE NAMED PASSWORD.

CURRENT VALUE: UNKNOWN

"Unknown?" Sam said. "What kind of variable is unknown?"

The sign under the screen read:

THE PASSWORD IS THE VALUE OF THE VARIABLE NAMED COUNT.

COUNT = TOTAL NUMBER OF TIMES THE WATERING CAN'S VALUE REACHED ZERO.

Priya frowned. "How many times did the water level reach zero? We filled it once, and we used it until it was empty."

"But every time we water a flower, the water level goes down," Kwame pointed out. "It reaches zero at the end of each watering session."

"Wait," Lily said. "We used the can once—in the wall of flowers. We started at five, and after ten flowers, it reached zero."

"Ten flowers, but each flower used one unit," Priya said. "The water level decreased by one each time. It hit zero after the tenth flower."

"So the variable COUNT equals... ten," Lily said slowly.

"Or one," Sam said quietly.

Everyone looked at Sam.

"Think about it," Sam said. "The variable is COUNT. It counts how many times WATER_LEVEL reached zero. Each time we water one flower, WATER_LEVEL goes down by one. But it only actually reaches zero once—after the last flower."

"But we watered ten flowers," Priya said. "Each time, the water level was lower. It was zero after one flower—the one that went from one to zero."

"No," Lily said, shaking her head. "After the ninth flower, water_level was one. After the tenth flower, it was zero. It hit zero once."

"Unless we count the fill," Kwame said. "We filled the can to five, then we watered one flower, and it went to four. That's not zero."

Priya walked in a circle, frustrated. "This is too fuzzy. We need to know what the door counts—the water can reaching zero, or something else."

The sign flickered:

ERROR: COUNT HAS NOT YET BEEN INCREMENTED TO THE CORRECT VALUE.

COUNT'S CURRENT VALUE: 0

"Zero?" Lily said, her eyes wide. "But the water level reached zero! We watched it!"

"Wait," Kwame said, reading his journal. "The watering can is named WATER_LEVEL. But the door's password is stored in the variable named COUNT. COUNT is a different variable. It hasn't been set yet."

"Set how?" Priya asked.

The sign flickered again:

COUNT IS INCREMENTED BY 1 EACH TIME THE DOOR IS KNOcked.

THE KNOCKER IS BESIDE THE DOOR.

They looked to the side. There was a bronze knocker shaped like a flower, mounted on a small plate.

"It's right there," Sam said. "We just have to knock!"

Priya grabbed the knocker and knocked three times. The screen updated:

COUNT'S CURRENT VALUE: 3

"Is three right?" Sam asked.

"I don't know," Priya admitted. "What's the password supposed to be?"

Kwame tapped his journal. "The password is the value of COUNT. But we don't know what password we need. The door hasn't told us."

"Maybe it tells us when we knock the right number of times," Lily speculated.

She took the knocker and knocked twice more.

COUNT'S CURRENT VALUE: 5

"Five?" Priya said. "Try more."

Sam knocked four times.

COUNT'S CURRENT VALUE: 9

Then Priya knocked once.

COUNT'S CURRENT VALUE: 10

The door's screen flickered, and a new line appeared:

PASSWORD = COUNT. COUNT = 10. PASSWORD = 10. DOOR UNLOCKED.

The door swung open.

"That was..." Sam started.

"A guess," Priya admitted. "We got lucky. But we know why it worked—COUNT reached 10, and 10 matched the number of flowers in the complete set. The door was using the same value we used for the bridge."

"Variables aren't just names," Lily said slowly. "They're ways to keep track of things. The bridge used the count of flowers. The door used the count of knocks. They're different variables, but they share the same value when they're both counting the same type of thing."

"Like how COUNT counted the flowers, and COUNT counted the knocks," Kwame said. "The variable is a name, and the value changes."

  1. Kwame's Journal & The Way Home

Inside the final room, the light of the laptop's doorway glowed warmly on the far wall. But before they left, Kwame pulled out his journal and sat on a stone bench.

"I need to write this down," he said, and the other kids gathered around as he read aloud:

"The Garden of Changing Things taught us about variables. A variable is like a treasure chest with a name on the outside. The chest can hold many different treasures, but you always call it by its name. WATER_LEVEL is a chest that holds numbers about water. GARDENIA_1 is a chest that holds colors. COUNT is a chest that holds knocks.

When we know the name of a thing, we can ask what value it holds. When we want to change something, we change what's in its chest. And when we want to solve a puzzle, we check the values of all the chests to see if the conditions are right.

The Grid is full of named things that hold values that change. That's what makes it alive, and that's what makes it possible to control it—because when something has a name, you can always find it, check it, and change it."

"That's beautiful, Kwame," Lily said quietly.

"It's true," he said. "That's the best way I can say it."

Priya looked at the glowing doorway. "We should go. But I want to remember one thing: variables are how the Grid tracks everything. They're how it knows what's true, what's happened, and what can change."

The laptop's glow pulsed, and the doorway began to hum. They stepped through, one by one, and the lost-and-found closet materialized around them.

The laptop's screen dimmed, then went dark.

Sam looked at the glowing case for a long moment. "The flower changed," they said. "But it was still the same flower. The name didn't change, even when the value did."

"That's the whole point," Priya said, smiling. "The name is always the same. That's how you keep track of which thing you're changing."

Outside, sunlight streamed through the school windows. And in the garden of their memory, ten orange flowers stood in perfect rows, each one holding its color like a secret they'd learn to read.