Port
INPUT / OUTPUT — *the doorway between the program and the world.* Input brings information IN (a key press, a sensor reading, a typed answer); output sends information OUT (a printed message, a moved motor, a lit screen). A program that can't take in or give out is sealed off from everything.
Press play to listen along. The line being read lights up as you go.
Show full transcript
Loading transcript…
Port is not an animal-tween. Port is not a faced figure. Port is a deliberately abstract concrete-object-figure — a sturdy doorway set into a wall, with an IN slot on one side and an OUT slot on the other. Messages slide in through one; results slide out the other. That is the whole figure.
This is essential. CodeRealm's cast is deliberately non-human and non-gendered — concrete objects, not people. The design refuses tech-genius-hagiography: coding isn't only for one "smart" kind of person. Primitives are operations, not personalities.
Port embodies the *input / output primitive. Input is information coming IN — a key pressed, a button tapped, a sensor read, an answer typed. Output* is information going OUT — a message printed, a motor moved, a light lit. Without Port, a program is sealed off, unable to hear the world or answer it.
Reflection: have you ever felt how good it is to truly be heard by someone, and to get a real answer back?
Port has no village-craft family origin — concrete objects don't have biographies. Loop, the mentor, introduces Port by demonstration.
Loop sets Port on the workbench beside Bit, the little robot the learner programs. "This is Port," Loop says. "The doorway. Everything the program learns from the world comes IN through here; everything it shows or does goes OUT through here."
Loop taps a key. The keystroke slides in the IN slot. Loop prints a message; the words slide out the OUT slot onto a little screen. "In, then out," Loop says. "A program with no Port can compute all day and no one would ever know. Port is how it connects."
Loop demonstrates Port's two directions with Bit.
"Bit has sensors and a voice," Loop says. "Both go through Port." Loop shows the scaffolds: - Input: read a key, a button, a sensor, or a typed answer — bring the value IN. - Output: print text, light a screen, move a motor — send a result OUT. - Store what comes in: input usually lands in a Stash box so the program can use it. - Wait for input: sometimes the program pauses at Port until something arrives.
"Port doesn't decide anything," Loop says. "It doesn't think. It just carries information in from the world and out to the world. That's all input and output are — the doorway."
Loop wires Bit up to actually read the world and answer it.
"Bit, ask the kid their name," Loop says. Bit sends a question OUT through Port: `What's your name?` The kid types `Sam`; the letters come IN through Port and land in a Stash box. Then Bit sends OUT: `Hi, Sam!`
The kid grins — Bit heard them and answered. Loop adds a light sensor. When the kid covers it, the reading comes IN through Port; Bit sends OUT a command and its lamp switches on. The program is no longer sealed off. It's reading the real world and responding.
Reflection: have you ever felt that lift when something you made actually responded to you?
Loop sets Port back in its wall, IN slot and OUT slot quiet again.
"Here's the honest framing," Loop says. "Port is not a mind. It does not think or decide. It is a doorway — information IN from the world, results OUT to the world. Read a key, move a motor, print a message. That is all input and output are."
But the kid, watching Bit greet them by name and answer a covered sensor, feels something real — the small, bright thrill of connection, of making something that truly listens and answers back. A program that reaches the world feels alive to the one who made it, and the kid feels that spark.
"This is Port," Loop says on the object's behalf. "Input and output. Information in from the world, results out to it. Read in, send out. Honest framing."
The doorway rests, ready for the next program — and the kid heads off glad, still warmed by the feeling of being heard and answered back.
The CodeRealm ensemble
Port is part of CodeRealm's distributed-narrative cast. Each character embodies a different curricular primitive; together they teach the full subject.
-
Stash
Variable / storage — the labeled box that holds a value until you call for it
-
Fork
Conditional / branching — chooses a path based on what's true right now
-
Trek
Loop / iteration — keeps going around until the work is done
-
Module
Function / encapsulation — does one job well and can be called anywhere
-
Glitch
Debugging / inspection — finds bugs gently, never shaming; 'there's always a reason'
-
Order
Sequence / syntax — reminds you that order matters in code
-
Row
A list: many values lined up in a numbered row, so you can grab item number three instantly or walk through them one by one.
-
Ping
An event: a waiting bell that does nothing until its trigger happens, then runs its code the instant it is struck.
-
Shuffle
Randomness: a fresh unpredictable value each time — a dice roll, a shuffled deck — so a program can surprise, vary, and stay fair.