← Library

The Logic League

Until Its Done

Until Its Done

The Bridge That Wouldn't Stop

The lost-and-found closet smelled like old sneakers and grape juice. Priya pushed through the hanging jackets, past a single roller skate and a very sad-looking umbrella, until she found the laptop exactly where they'd left it. Its screen glowed softly, like it had been waiting.

"Is everyone ready?" she asked.

Kwame adjusted his glasses. "Ready to see what the Grid throws at us this time."

Lily was already peeking over Priya's shoulder. "I hope there's something to fix."

Sam bounced on their heels. "I hope there's something to break!"

The laptop's screen brightened. A green light spilled across their faces, and the lost-and-found closet dissolved into the bright geometric tunnels of the Entry Zone.

They landed at the edge of a wide chasm. Across it stretched a bridge made of glowing golden tiles—except it wasn't a bridge exactly. It was a machine of a bridge. Tiles moved along a track in a continuous loop, sliding from the far side to the near side, then underneath and around to the far side again. It looked like a conveyor belt standing on edge.

"That doesn't look safe," Sam said.

Priya studied it. "It's not supposed to look safe. It's supposed to work."

A glowing sign near the edge read:

TILE-BRIDGE v6.3

To cross: step onto a tile. The bridge will carry you across.

Exit condition required before crossing.

"Exit condition?" Kwame read. "What does that mean?"

"I don't know what it means yet," Priya said, "but I bet we find out."

Sam stepped toward the bridge, and the closest tile slid toward them with a soft click-hiss. "Looks easy. We just hop on and ride."

Priya grabbed Sam's sleeve. "Wait. Did you read the sign? It says exit condition required. That sounds important."

"Maybe it's just a warning label," Sam said. "Like 'don't eat the toothpaste.'"

"Toothpaste isn't a bridge," Lily pointed out.

Before anyone could argue further, the bridge made a decision for them. A tile snapped forward, scooped Sam up, and carried them toward the far side.

"Whoa!" Sam yelled, but they weren't scared—they were delighted. "This is the best bridge ever!"

The tile slid across the chasm, smooth and fast. Sam reached the far side, stepped off onto solid ground, and turned to wave. "See? Easy!"

The tile that had carried Sam swung underneath the track and came back around toward them, ready for its next passenger.

"Okay," Priya said. "So we each just take a tile to the other side. Simple."

She stepped onto the next tile. It carried her across smoothly. Lily went next, then Kwame. The bridge worked perfectly.

"Great," Priya said, looking at the far side. "So what's the puzzle?"

The glowing sign echoed across the chasm in huge block letters:

ERROR: No condition was satisfied. The loop will continue until one is.

The Loop That Forgot to Stop

Behind them, the bridge kept moving. Tiles slid across, dropped nothing at the far side, swung underneath, and came around again. Click-hiss. Click-hiss. Click-hiss.

"That's what it does," Kwame said slowly. "It just... keeps going."

"Of course it keeps going," Priya said. "It's a bridge. It's supposed to work."

Lily was staring at the moving tiles with narrowed eyes. "But what's it waiting for? The sign said exit condition required. We crossed. That should have been enough."

The bridge ground on. Click-hiss. Click-hiss. Click-hiss.

Sam walked back to the edge where they'd started—except it wasn't a start anymore. The tiles were moving exactly the same way they had before. The bridge wasn't trying to get to the other side. There was no "other side" to the bridge itself. It was just a loop. A loop that had been running since before they arrived and would keep running after they left.

"It's not a bridge," Sam said quietly. "It's a... a machine that carries things from one side to the other. And it never stops doing it."

"That's dumb," Priya said. "Why would you build a bridge that never stops?"

"Because nobody told it to stop," Lily said. "Look at the sign again."

They all looked back at the sign:

TILE-BRIDGE v6.3

To cross: step onto a tile. The bridge will carry you across.

Exit condition required before crossing.

Kwame read it out loud, slowly. "Exit condition... required... before crossing."

"Before crossing?" Priya's eyes went wide. "We were supposed to set the exit condition before we got on?"

An error message flickered in red block text:

ERROR: Task will repeat while no exit condition exists.

The bridge kept moving. Click-hiss. Click-hiss. Click-hiss.

"Let me think," Priya said, pacing. "The bridge is a loop. It does the same thing over and over. That's fine—loops are efficient. But a loop needs something to tell it when to stop. A condition."

"Like a rule," Kwame said. "The bridge keeps carrying tiles while..." He trailed off.

"While what?" Lily asked.

Everyone was quiet for a moment. The bridge hummed along.

"While there's somebody to carry?" Sam suggested. "But we're already across. There's nobody left to carry."

Kwame's face lit up. "So the condition could be: while there is someone waiting on this side, carry them across. When nobody's waiting—stop."

"That's clever," Priya said, "but how do we tell the bridge that?"

They walked back toward the sign. Behind it, they found something they'd missed before: a small panel covered in glowing shapes. It looked like a door lock, but instead of a keypad, there was a single line of text and an empty space after it.

The panel read:

WHILE [ waiting passengers > 0 ]:

Carry tile across

Drop off passenger

EXIT CONDITION: [________________]

The Question That Changed Everything

"I get it," Lily said, leaning close to the panel. "The bridge is following an instruction: while people are waiting, carry them. It's a while-loop. It repeats as long as the condition is true."

"But we need to write the exit condition," Priya said. "What comes after 'while' should tell the bridge when to stop doing the thing."

Sam looked confused. "Wait. If the bridge does the thing while people are waiting... then when people stop waiting, the bridge stops. Doesn't it?"

"That's what I said," Lily said.

"No," Sam said. "I mean, isn't that just... what happens? Like, if I bounce a ball until I get tired, I stop when I'm tired. I don't need a special sign to tell me."

Everyone turned to look at Sam.

"You're right," Kwame said slowly. "You're totally right. A while-loop needs a condition. But the condition is already there: waiting passengers. If there are zero waiting passengers, the loop should end on its own."

Priya shook her head. "But the bridge didn't stop. Even after we crossed."

"Because the bridge's condition isn't watching passengers," Lily said. "Look at the code it's running. The loop says: carry tile across, drop off passenger. It doesn't check anything before it decides to keep going. It just... goes."

"So it's a loop that never checks whether it should keep going," Kwame said. "That's why it's stuck. It's an infinite loop."

Sam raised their hand, the way they did in school. "But why would someone build a bridge that doesn't check anything?"

"Maybe they didn't mean to," Priya said. "Maybe they built the loop and forgot to add the condition. They thought it would stop when it was done, but the bridge doesn't know what "done" means unless someone tells it."

Lily was already at the panel, her fingers hovering over it. "We can fix this. We just need to add the exit condition."

"Wait," Sam said. "Before we fix it—shouldn't we decide what the exit condition should be? Like, we need to pick the right one."

"Any condition would work," Priya said. "The bridge just needs something."

"No, but—" Sam pressed on. "If we tell the bridge to stop when waiting passengers are zero, it'll stop right now, because there's nobody waiting. But if someone comes later who needs to cross, the bridge won't carry them. The condition has to be about when the bridge should start stopping."

Everyone was quiet.

"That's the smartest thing I've ever heard," Kwame said.

Sam grinned. "I have them sometimes."

Lily was thinking hard. "Sam's right. The exit condition isn't just about stopping. It's about making sure the loop only runs when it should run. The while condition and the exit condition—they're the same thing. The bridge should run while there are people who need to cross. When there's nobody, it rests."

Priya was already typing. "So we write: WHILE waiting passengers > 0. When the last passenger crosses, the loop checks, sees zero, and stops."

"But what if the next passenger arrives after the bridge stops?" Sam asked. "The bridge won't carry them."

Lily shook her head. "It will. When a passenger walks up, the condition becomes true again, and the loop starts again. It's not a one-time stop. It's a pause—a rest state."

"The loop isn't gone," Kwame said. "It's just... waiting for the right time to be useful."

Priya typed the condition. The panel glowed green.

EXIT CONDITION: while waiting passengers > 0

For a moment, nothing happened. Then the bridge's tiles slowed. One more tile slid across, carrying nothing. Then another. Then the bridge stopped. The tiles sat still, calm, silent.

The error message faded, replaced by a simple confirmation:

LOOP TERMINATED. STANDING BY.

"Is it broken?" Sam whispered.

Priya shook her head. "It's resting. It'll start again when someone needs it."

Lily smiled. "It's not broken. It's finished."

Kwame's Journal

That night, back in the lost-and-found closet (which smelled exactly like old sneakers and grape juice, as if the Grid had never happened), Kwame sat at home and wrote in his journal:

A loop is like a story that repeats until something in the story changes. The bridge carried passengers while passengers were waiting. That was its story. But a story needs an ending—not to stop forever, but to know when to pause and let the page breathe. An infinite loop is a story that never finds its ending. It's not excitement. It's a character running in circles, forever, because nobody told them the quest was complete. When you build a loop, you have to decide before you start: what will make this end? Because a loop without an exit isn't a loop. It's a cage.

He underlined one sentence and drew a small bridge in the margin, with a tiny figure standing on it, waving.

The best loops are the ones that know when to stop.

He closed the journal and smiled. Tomorrow, they'd find out what the Grid had in store next. But for now, the bridge could rest. And so could they.