Part Two · Bugs and Patterns

Chapter 7: The Robot Game

8 minute read · David Jean Charlot, PhD

Coding class with computers
Coding class with computers

Room 14 at the community center had been transformed.

Usually this room was for arts and crafts—Mateos remembered coming here last year for a finger painting class that had ended with blue hands and a very colorful shirt that Mama had to wash three times. But today, all the art supplies were gone.

Laptop computers sat on tables arranged in a horseshoe shape. A big screen at the front showed colorful blocks stacked together like digital Legos. The floor had tape marking out a grid of squares, like a giant board game or a chessboard come to life.

“Welcome, coders!” The instructor had purple-streaked hair and a t-shirt that said DEBUGGING IS MY CARDIO. “I’m Jasmine. Today, we’re going to learn something magical: how to tell computers exactly what to do.”

Mateos found a spot at one of the tables and was surprised to see a familiar face next to him.

“Ezi?”

She grinned, pushing up her glasses. “Mateos! My mom signed me up. She said I need 'screen time that counts.'” She made air quotes with her fingers.

A nervous-looking girl with two braids sat on Mateos’s other side. “I’m Nadia. I’ve never used a computer before. Is that bad?”

“Me neither!” Mateos said. “I mean, I’ve used computers, but I’ve never made them do anything. Except once I accidentally deleted all of Mama’s photos and she was really upset until Daddy fixed it.”

Nadia laughed, looking less nervous. “My mom would probably cry if I did that.”

Jasmine clapped her hands. “Okay, future programmers! First rule of coding: computers can’t guess what you mean. They follow instructions exactly. If you tell a computer to take ten steps forward and there’s a wall after five steps—”

“It’ll bonk into the wall!” Declan shouted from across the room. (Declan was everywhere, apparently. Mateos was starting to think Declan might be at every event in the entire city.)

“Exactly! It won’t think, 'Oh, there’s a wall, I should stop.' It’ll just keep trying to walk forward until something breaks.” Jasmine grinned. “So before we touch any computers, we’re going to practice giving instructions with—each other. Welcome to the Robot Game.”

She explained the rules: one kid was the “robot,” one kid was the “programmer.” The robot could only do exactly what the programmer said—step forward, turn left, turn right. No thinking for themselves, no interpreting vague commands, no figuring out what the programmer “probably meant.”

“Robots don’t have common sense,” Jasmine said. “They have instructions. Big difference.”

Mateos was a programmer first, with Ezi as his robot. She stood at one corner of the grid, her glasses crooked, trying not to laugh. A gold star sticker sat at the opposite corner.

“Okay, um… walk forward.”

Ezi took one step.

“No, more forward.”

“You didn’t say how many steps,” Ezi said, pressing her lips together to keep from giggling.

“Oh! Uh, three steps forward.”

Ezi walked three squares—right into the “wall” (a row of orange cones).

“The walls!” Mateos groaned. “I forgot about the walls!”

Jasmine appeared beside them, still smiling. “What happened?”

“I told her to go forward but she hit the wall.”

“Did you check the path first?”

Mateos looked at the grid. Really looked, this time. There was a clear route that went around the cones—forward two squares, turn right, forward three squares, turn left, forward two squares. He could see it perfectly in his mind. But he hadn’t told Ezi to go that way.

“I knew the right way in my head, but I didn’t say it.”

“That’s the most important lesson in all of programming,” Jasmine said, and her voice got serious. “The computer—or robot—can’t see inside your head. You have to translate what you’re thinking into steps they can follow. Every single step. Nothing assumed, nothing skipped.”

They reset. Ezi went back to the starting corner. Mateos thought for a long moment, tracing the path with his eyes.

“Two steps forward.”

Ezi stepped. One. Two.

“Turn right.”

Ezi pivoted.

“Three steps forward.”

One. Two. Three.

“Turn left.”

Pivot.

“Two steps forward.”

One. Two. Ezi was standing on the star.

“YES!” They both cheered, and even Jasmine clapped.

“You did it!” Jasmine said. “You just wrote your first algorithm.”

“Al-go-rithm?” Mateos tasted the new word. It was even bigger than metamorphosis.

“A set of step-by-step instructions to solve a problem. Every app, every game, every website—they’re all built from algorithms. Thousands of them. Millions of them. All just step-by-step instructions, one after another, telling the computer exactly what to do.”

scratch cat

After the robot game, they moved to the computers.

Jasmine showed them a program called Scratch, where you connected colorful blocks to make a character move, spin, dance, and even meow. The blocks snapped together like puzzle pieces, each one a different instruction.

When green flag clicked— this was the starting signal Move 10 steps— this made the character walk Turn 15 degrees— this made the character rotate Play sound meow— this made the character… well, meow

Mateos got lost in it immediately.

He stacked blocks together, experimenting:

When green flag clicked Forever: , ' Move 10 steps , ' Turn 15 degrees

The cat spun in circles, around and around, leaving a trail on the screen. He added a meow block inside the forever loop, and suddenly the cat was spinning AND meowing continuously, an endless whirlwind of fur and sound.

“I broke it,” he said, but he was laughing.

“You didn’t break it!” Jasmine appeared over his shoulder. “You discovered something. What happens when you put a meow inside a forever loop?”

“It never stops meowing?”

“Exactly. That’s not a bug—that’s a feature. Or a bug, depending on whether you wanted infinite meowing.”

“I don’t think anyone wants infinite meowing.”

“You’d be surprised. Some people definitely do.”

Mateos kept experimenting. He changed the numbers—bigger steps, sharper turns—and the cat went crazy, bouncing off the edges of the screen. He added a different character, a star, and made it glide to random spots. Then he made the cat chase the star.

“I’m going to make a game for Natania,” he announced. “With stars she can catch.”

By the end of class, he had something—not quite a game, but almost. A cat that chased a star that moved randomly around the screen. When the cat touched the star, it made a pop sound and the star jumped somewhere else.

“This is awesome,” Ezi said, watching over his shoulder. “Can you teach me how you made the star move?”

“Yeah! So you use this glide block, but you put random numbers in it, and then—”

Jasmine called for attention. “Before we go, one more thing. Raise your hand if your program didn’t work the first time.”

Every hand went up.

“Raise your hand if it still doesn’t work exactly how you want.”

Almost every hand stayed up.

“That’s normal. That’s actually good. When something doesn’t work, we call that a bug. And finding bugs isn’t failing—it’s just part of the process. The debugging IS the coding. You’ll never write a perfect program on the first try. Nobody does. Not even the people who work at Google or Apple or anywhere. The skill isn’t writing perfect code—the skill is finding the bugs and fixing them.”

Mateos thought about the toaster. About Natania’s words: Computers do exactly what you tell them.

He had told the cat to chase the star. And it had.

He had told Ezi to walk into a wall. And she had.

Every mistake was just information. Every bug was just a clue about how to do it better next time.

—-