Chapter 1: The Code Portal: Lila’s First Glimpse of Computational Thinking
The dust motes dancing in the slant of late afternoon sun caught Lila’s eye first, swirling around the faded cardboard boxes stacked in the corner of her grandparents’ attic. She’d been sent up to sort through the clutter ahead of the family’s annual spring cleaning, a task she’d grumbled about until her fingers brushed against the cold, matte plastic of a ThinkPad laptop tucked under a pile of her dad’s old college textbooks. The lid was scuffed at the edges, covered in stickers she didn’t recognize: a polar bear balancing on a chunk of sea ice, a sprouting seedling, a tiny solar panel with the words “Code for Climate” scrawled in messy black marker next to it. Her grandpa, a retired middle school technology teacher who’d passed away six months earlier, had always filled his notebooks and laptop cases with doodles like this, but she’d never seen this particular sticker before.
She pried the laptop open, blowing a layer of dust off the keyboard. The power light flickered once, twice, then the screen glowed to life with a custom boot screen she’d never seen before: a looping animation of a small green tree sapling growing taller, its leaves unfurling as a familiar voice—warm, slightly scratchy, the exact same voice her grandpa used when he led his after-school coding club for elementary kids—filled the quiet attic. “Hello, Lila,” the voice said. The sapling on the screen waved its tiny branches. “I’m Miko, your grandpa’s coding assistant. He’s been waiting for you to find this.”
Lila’s throat tightened. Her grandpa had left dozens of boxes of teaching materials in the attic, but she’d been too sad to go through them until now. “What is this?” she whispered, her fingers hovering over the trackpad.
“This is the portal to your grandpa’s unfinished legacy project,” Miko replied, the sapling on the screen tilting as if to look at her. “For the last three years of his life, he’d been developing a free coding curriculum and global challenge for teen coders focused on climate action. He called it the *Global Youth Climate Code Challenge*. He registered it with the United Nations Youth Climate Summit last year, and it’s set to launch globally this fall. He wanted you to be the first to test it.”
A pop-up window appeared on the screen, showing a photo of her grandpa standing on a stage in front of a crowd of hundreds of kids, all holding up handmade signs that said “CODE FOR THE PLANET” and “I <3 RENEWABLE ENERGY.” Lila remembered that day: she’d been 10, and she’d snuck into the back of the auditorium to watch him speak, too shy to go say hi afterward. She’d always thought coding was something for boys, or for kids who were way better at math than she was. She’d never even tried it.
“I don’t know how to code,” she said, her voice small.
“You already do,” Miko said, and a second window popped up, showing the spreadsheet Lila had made two weeks earlier for her school’s environmental club, calculating how much carbon the grade had saved by switching to reusable water bottles. “Your grandpa used to say that computational thinking isn’t just for programmers. It’s a way of solving problems that everyone uses, every day, even if they don’t call it that. Let’s break down what you did when you made that spreadsheet, okay?”
What Is Computational Thinking? It’s Not Just for Programmers
<!-- 纸书格式:此处为侧边栏提示,印刷时放在页面右侧,背景为浅灰色,标题为“核心概念:计算思维” --> <!-- 电子版格式:此处添加超链接,指向周以真教授2006年《计算思维》原始论文 https://dl.acm.org/doi/10.1145/1118178.1118215 --> <!-- Markdown标签:<tag>computational_thinking</tag> <tag>problem_solving</tag> -->
Miko pulled up a blank canvas on the screen, and the sapling drew four icons one by one as she spoke: a puzzle piece, a repeating pattern, a simplified outline of a tree, and a numbered list. “Computational thinking has four core parts, first defined by computer scientist Jeannette Wing in 2006. Let’s map them to the work you did for the environmental club, so you can see how you’re already using them.”
The first icon, the puzzle piece, lit up. “First is decomposition: breaking a big, scary problem into small, manageable pieces. When you calculated the carbon savings for your grade, you didn’t try to do it all at once. You broke it into: 1) count how many reusable bottles each student uses per day, 2) calculate the total number of bottles used by the whole grade per week, 3) multiply that by the carbon footprint of one plastic bottle, 4) add up the savings from the reusable bottles. That’s decomposition. It’s the same thing you do when you’re planning a school project, or even cleaning your room: you don’t clean the whole room at once, you do the desk, then the floor, then the closet.”
The second icon, the repeating pattern, glowed next. “Second is pattern recognition: finding similarities or trends in the small pieces you broke the problem into. When you looked at the bottle usage data, you probably noticed that Mondays have the highest number of bottles, because kids bring new snacks after the weekend, and Fridays have the lowest, because kids are excited for the weekend. That’s a pattern. In programming, pattern recognition lets you reuse code instead of writing the same thing over and over again. For example, if you’re making a quiz with 10 questions, you’ll notice all the questions follow the same ‘ask → check answer → give feedback’ pattern, so you can write that logic once and reuse it for all 10 questions.”
The third icon, the simplified tree outline, lit up. “Third is abstraction: ignoring the unimportant details to focus on the core idea. When you calculated the carbon savings, you didn’t need to track the color of each bottle, or what brand of water each kid used, or what time of day they drank it. You only cared about the number of bottles, and the carbon footprint per bottle. You abstracted away the irrelevant details. In programming, abstraction is what lets you use pre-written code blocks (like the Scratch ‘say’ block, or the Python `print()` function) without needing to know exactly how they work under the hood. It’s also what lets you make a reusable ‘quiz question’ block that works for any question, instead of writing new code for every single one.”
The fourth icon, the numbered list, glowed last. “Fourth is algorithm design: writing a step-by-step set of instructions to solve the problem, that anyone (or any computer) can follow. The steps you wrote for your carbon calculation are an algorithm: 1) enter daily bottle count per student, 2) multiply by 5 school days, 3) multiply by 12 classes, 4) multiply by 0.025kg CO₂ per bottle, 5) output total savings. Algorithms have to be clear, unambiguous, and in the right order—if you multiply before you add up the total bottle count, you’ll get the wrong answer.”
To make the connection even clearer, Miko pulled up a Mermaid flowchart mapping the four computational thinking steps directly to the climate quiz project Lila was about to build: ```mermaid graph TD A[分解任务:把气候问答拆成开场动画/问答模块/知识卡片3个独立模块] --> B[模式识别:发现所有选择题都遵循“提问→等待输入→判断答案→给反馈”的重复逻辑] B --> C[抽象:把重复的答题逻辑做成通用模块,新增题目只需修改问题和正确答案] C --> D[算法设计:按顺序执行开场→主界面选择→对应模块运行→显示最终结果的步骤] D --> E[生成可交互、可测试的Scratch原型] ``` <!-- 纸书格式:此处为图1.1
The flowchart glowed softly on the screen, each step pulsing in time with Miko’s words, but Lila still frowned, tapping the trackpad with a finger. “I get that I used those steps for the spreadsheet,” she said, “but how does that translate to making a… quiz thing? I’ve never even touched code before.”
Miko chuckled, and the little sapling avatar on the screen leaned forward, its leaves brushing against the edge of the flowchart. “Let’s take a step back. Have you ever seen one of those after-school coding club Scratch projects your grandpa used to post on the classroom blog? The ones with the jumping cat and the moving obstacles?”
Lila nodded. She’d spent half an hour watching those videos when she was 10, too shy to sign up for the club herself. “Those are just games. They don’t