Shuffle

RANDOMNESS — a value you can't predict, drawn fresh each time (a dice roll, a shuffled deck, a coin flip). Each draw is independent: the generator has NO memory and no fairness-debt, so two of the same in a row does not make the next one less likely (the gambler's fallacy).

Loading audio…

Press play to listen along. The line being read lights up as you go.

Show full transcript

Loading transcript…

01 Opening
Shuffle beat 1 of 5

In the corner of the CodeRealm workshop sat a covered cup, and at that exact moment it was doing something no one in the room could predict. Loop had it on the bench before a class of squinting kids — a plain lidded tumbler that, when shaken, made a dry, rattling music: a whole crowd of small numbered tokens knocking together in the dark. "This is Shuffle. Randomness. Watch closely, because I promise I don't know what happens next either." He tipped the cup; a single token slid out and rolled to a stop. 4. He scooped it back, capped, shook — that rattling music — and drew again: 1. Then 6. Then 1 a second time. A kid leaned forward, frowning. "Do it once more." 3. The kid sat back, a little defeated and a little delighted, because they'd genuinely been trying to guess and there had been nothing to grab onto — no pattern, no rhythm, no next-in-line. "That's the whole job," Loop said. "When a program needs something you can't guess ahead of time — a dice roll, a random enemy, a shuffled quiz — you draw from Shuffle. A value nobody can see coming. Not the workshop, not you, not even me."

02 Shuffle
Shuffle beat 2 of 5

Loop noticed a kid at the back who wasn't laughing. This kid had built a guessing game the week before, and it had failed in the most boring way possible: every time you played, the "secret" number was 7. Always 7. The first player found it in one run, told everyone, and the game was dead. "It wasn't broken," the kid said, miserable. "It ran perfectly. It was just... the same. Every time. I made a game that couldn't surprise anybody." Loop pulled the cup over. "You didn't need a bigger machine. You needed one that forgets. Watch." He shook and drew — 5 — capped, shook, drew again — 2. "It doesn't remember the last draw. It has no favourite number. There's no seven waiting in there for you to trip over. Every draw is independent — fresh, on its own." The kid picked up the cup, shook, drew 6, shook, drew 1 — and something loosened in their chest, the flat stuck feeling of the same, the same, the same lifting off, replaced by the small rising fizz of I don't know what's next. "That jumpy, don't-know feeling," Loop said gently, "is the thing your game was missing. Not a bug. A surprise."

03 Shuffle
Shuffle beat 3 of 5

The kid brought their game back the next morning and set the cup on the bench like it belonged there. "I want to build it right this time." Loop didn't ask them to prove anything; he asked one question. "What does randomness give a program?" The kid didn't answer with words. They wired Shuffle into the guess-a-number game so each round drew a fresh secret token from 1 to 9 — and made Loop play it. Loop guessed 4; wrong, it was 8. Reset. Loop guessed 8 on purpose this time, grinning; wrong again, it was 2. "You can't cheat it," the kid said, "because I don't even know what it'll draw. It picks fresh, every round, from the cup." Loop played three more rounds, lost every guess, and by the end was laughing. "You belong here," he said, and set the cup back beside the game like it had always lived there.

04 Shuffle
Shuffle beat 4 of 5

By afternoon the kid had a little crowd, and one wanted a game of their own. "I need dice for a board game. But how does a cup roll a six?" The kid who now understood Shuffle pulled the cup over. "You put six tokens in — 1 to 6. Shake." Rattle. "Draw." 3. "There's your roll. Want a coin flip? Two tokens. Want a random cheer? Fill a list with phrases, shuffle, draw one. Same idea every time: shake, draw, get a fresh one." The new kid dropped in six tokens and drew. 5. Then 5 again. "Wait — two fives! Is it stuck? Am I due for a low one now?" The first kid shook their head, remembering exactly how Loop had said it. "That's the honest part, and it's the trap almost everyone falls into — the gambler's fallacy. It doesn't keep score. Two fives in a row doesn't make the next draw any less likely to be a five. The cup has no memory and no fairness-debt — it isn't 'saving up' a low number for you. Every draw is independent, completely on its own." The new kid drew again, half-braced for a five, and got 1, and the whole small crowd let out a whoa.

05 Closing
Shuffle beat 5 of 5

When the workshop emptied, the first kid stayed with the cup, running their fixed game one more time, alone. They'd wired it to draw a fresh secret number and a random cheer and shuffle the questions into a new order. Run: 3, a chirped Nice one!, questions in one order. Run again: a different secret, a different cheer, a different order entirely. Same exact code. Brand-new run. And then it happened — the game surprised them, its own builder — and they laughed out loud in the empty room. The cup sat on the bench, lid on, tokens hidden, quietly ready for the next shake. It wasn't thinking. It wasn't feeling lucky. It was just a cup of tokens you shook and drew from, fresh and independent every time. But the kid, watching a thing they'd made astonish the one who made it, felt the brightest, jumpiest kind of happy — the delight of not knowing what comes next, of building something alive enough to still amaze its author. They shook the cup once more before they left, just to feel that small rising fizz, drew a 6, and grinned all the way out the door.

The CodeRealm ensemble

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