# Level 2: 6-8 年级 (11-14 岁)

# 计算机系统

Computing Systems

序号 标准和描述 相关概念 实践
2-CS-01 Recommend improvements to the design of computing devices, based on an analysis of how users interact with the devices.
根据用户与设备的交互分析, 对计算机设备的设计提出改进建议
The study of human–computer interaction (HCI) can improve the design of devices, including both hardware and software. Students should make recommendations for existing devices (e.g., a laptop, phone, or tablet) or design their own components or interface (e.g., create their own controllers). Teachers can guide students to consider usability through several lenses, including accessibility, ergonomics, and learnability. For example, assistive devices provide capabilities such as scanning written information and converting it to speech.
"人机交互 (HCI)"的研究可以改善设备硬件和软件的设计. 学生应该对现有的设备(比如笔记本电脑、电话、平板电脑)提出建议, 或者设计自己的组件和界面(比如, 创建自己的控制器). 老师可以引导学生从多个角度来考虑可用性, 包括可访问性、人体工程学和可学习性. 比如, 提供扫描书面信息并将其转换为语音的功能的辅助设备.
Devices
设备
3.3
2-CS-02 Design projects that combine hardware and software components to collect and exchange data.
设计一个硬软件结合的进行数据收集和交换的项目
Collecting and exchanging data involves input, output, storage, and processing. When possible, students should select the hardware and software components for their project designs by considering factors such as functionality, cost, size, speed, accessibility, and aesthetics. For example, components for a mobile app could include accelerometer, GPS, and speech recognition. The choice of a device that connects wirelessly through a Bluetooth connection versus a physical USB connection involves a tradeoff between mobility and the need for an additional power source for the wireless device.
数据的收集和交换, 涉及到输入、输出、存储、处理. 如果可能的话, 学生应该通过考虑功能、成本、大小、速度、可访问性和美观等因素, 来选择项目设计的硬件和软件组件. 比如说, 移动应用程序的组件可以包括加速计、GPS 和语音识别. 选择通过蓝牙无线连接的设备还是通过物理 USB 连接的设备, 需要在移动性和无线设备需要额外电源的问题之间进行权衡.
Hardware & Software
硬件 & 软件
5.1
2-CS-03 Systematically identify and fix problems with computing devices and their components.
系统地识别和修复计算机设备及其组件的故障
Since a computing device may interact with interconnected devices within a system, problems may not be due to the specific computing device itself but to devices connected to it. Just as pilots use checklists to troubleshoot problems with aircraft systems, students should use a similar, structured process to troubleshoot problems with computing systems and ensure that potential solutions are not overlooked. Examples of troubleshooting strategies include following a troubleshooting flow diagram, making changes to software to see if hardware will work, checking connections and settings, and swapping in working components.
由于计算机设备可能与系统内相互连接的设备相互影响, 所以问题可能不是由于计算机设备本身引起, 而是与之相连的设备引起. 就像飞行员使用检查表来排除飞机系统故障一样, 学生应该使用类似的结构化流程来排除计算系统的故障, 来确保潜在的解决方案不会被忽略. 故障排除策略的例子包括: 故障排除流程图、对软件进行更改来查看硬件是否工作、检查连接和设置、更换工作部件
Troubleshooting
故障排除
6.2

# 网络与互联网

Networks and the Internet

序号 标准和描述 相关概念 实践
2-NI-04 Model the role of protocols in transmitting data across networks and the Internet.
对"协议"在跨网络和互联网传输数据方面所起的作用, 进行模拟
Protocols are rules that define how messages between computers are sent. They determine how quickly and securely information is transmitted across networks and the Internet, as well as how to handle errors in transmission. Students should model how data is sent using protocols to choose the fastest path, to deal with missing information, and to deliver sensitive data securely. For example, students could devise a plan for resending lost information or for interpreting a picture that has missing pieces. The priority at this grade level is understanding the purpose of protocols and how they enable secure and errorless communication. Knowledge of the details of how specific protocols work is not expected.
"协议"是计算机之间如何发送消息的规则. 它们决定了信息在网络和互联网上传输的速度和安全, 也决定了如何处理传输中的错误. 学生应该使用协议来模拟数据的发送方式, 来选择最快的传输路径、处理丢失的信息、安全地传递敏感数据. 比如说, 学生可以设计一个重新发送丢失信息的机制, 或是解读有数据丢失的图片的机制. 这个学习阶段的学习重点是, 理解协议的目的以及如何实现安全无误的通信. 学生不需要了解具体的协议工作细节.
Network Communication & Organization
网络通信 & 网络架构
4.4
2-NI-05 Explain how physical and digital security measures protect electronic information.
解释物理和数字安全措施如何保护电子信息
Information that is stored online is vulnerable to unwanted access. Examples of physical security measures to protect data include keeping passwords hidden, locking doors, making backup copies on external storage devices, and erasing a storage device before it is reused. Examples of digital security measures include secure router admin passwords, firewalls that limit access to private networks, and the use of a protocol such as HTTPS to ensure secure data transmission.
存储在网络上的信息很容易被未经授权的人访问. 保护数据的物理安全措施包括隐藏密码、锁门、在外部存储设备上保存备份副本、在存储设备被他人使用之前删除数据. 数字安全措施包括安全的路由器管理密码、限制访问私有网络的防火墙、使用诸如HTTPS之类的协议来确保数据的安全传输
Cybersecurity
网络安全
7.2
2-NI-06 Apply multiple methods of encryption to model the secure transmission of information.
模拟信息传输的多种加密方法
Encryption can be as simple as letter substitution or as complicated as modern methods used to secure networks and the Internet. Students should encode and decode messages using a variety of encryption methods, and they should understand the different levels of complexity used to hide or secure information. For example, students could secure messages using methods such as Caesar cyphers or steganography (i.e., hiding messages inside a picture or other data). They can also model more complicated methods, such as public key encryption, through unplugged activities.
加密可以像替换字母那样简单, 也可以像现代网络和互联网的安全加密方法那样复杂. 学生应该使用各种加密方法对信息进行编码和解码, 他们应该了解用于隐藏或者保护信息的不同加密方法的不同复杂程度. 比如说, 学生可以使用诸如 Caesarcyphers 或 steganography(即将信息隐藏在图片或者其他数据中)之类的方法来保护信息. 他们还可以通过"不插电的电脑活动"[1]来模拟更复杂的信息加密方法, 比如"公钥加密"
Cybersecurity
网络安全
4.4

# 数据与分析

Data and Analysis

序号 标准和描述 相关概念 实践
2-DA-07 Represent data using multiple encoding schemes.
使用多种编码方案表示数据
Data representations occur at multiple levels of abstraction, from the physical storage of bits to the arrangement of information into organized formats (e.g., tables). Students should represent the same data in multiple ways. For example, students could represent the same color using binary, RGB values, hex codes (low-level representations), as well as forms understandable by people, including words, symbols, and digital displays of the color (high-level representations).
数据的表示方式发生在多个抽象层次上, 从"位"[2]的物理存储到将信息排列成有组织的格式(例如"表格"). 学生应该用多种方式表示相同的数据. 例如, 学生可以使用二进制、RGB 值[3]、十六进制代码(低层表示), 以及人们可以理解的形式, 包括用文字、符号和颜色的数字显示(高层表示)来表示同一种颜色
Storage
存储
4
2-DA-08 Collect data using computational tools and transform the data to make it more useful and reliable.
使用计算机工具收集转换数据, 使数据更有用更可靠
As students continue to build on their ability to organize and present data visually to support a claim, they will need to understand when and how to transform data for this purpose. Students should transform data to remove errors, highlight or expose relationships, and/or make it easier for computers to process. The cleaning of data is an important transformation for ensuring consistent format and reducing noise and errors (e.g., removing irrelevant responses in a survey). An example of a transformation that highlights a relationship is representing males and females as percentages of a whole instead of as individual counts.
随着学生继续建立他们组织和展示数据的能力, 以可视化的方式支持一个主张时, 他们需要了解什么时候以及为什么样的目的来转换数据. 学生应该转换数据, 来消除错误、突出显示或者展示数据之间的联系, 从而让数据更容易被计算机处理. "数据清洗"是数据分析的一个重要转换步骤, 用来确保数据的格式一致、减少无效数据和错误数据(比如说, 删除调查中不相关的回答). 一个"强调数据联系"的例子是, 展示男性和女性占据男女总数的百分比, 而不是单独展示男性总数和女性总数.
Collection Visualization & Transformation
数据收集 & 数据可视化 & 数据转化
6.3
2-DA-09 Refine computational models based on the data they have generated.
根据所生成的数据, 来完善计算模型
A model may be a programmed simulation of events or a representation of how various data is related. In order to refine a model, students need to consider which data points are relevant, how data points relate to each other, and if the data is accurate. For example, students may make a prediction about how far a ball will travel based on a table of data related to the height and angle of a track. The students could then test and refine their model by comparing predicted versus actual results and considering whether other factors are relevant (e.g., size and mass of the ball). Additionally, students could refine game mechanics based on test outcomes in order to make the game more balanced or fair.
"模型"可以是对事件的数字模拟, 也可以是各种数据之间关系的表示. 为了完善模型, 学生需要考虑哪些数据点是相关的、数据点之间的关系、数据是否准确. 比如说, 学生可以根据与球的运动轨道的高度和角度相关的数据, 来预测球的运动距离. 然后,学生可以通过比较预测的结果和实际的结果, 并考虑其他因素是否相关(例如球的大小和质量), 来测试和完善他们的模型. 此外, 学生还可以根据测试的数据结果来改进游戏机制, 使游戏更加平衡或者公平.
Inference & Models
推理 & 模型
5.3
4.4

# 算法与编程

Algorithms and Programming

序号 标准和描述 相关概念 实践
2-AP-10 Use flowcharts and/or pseudocode to address complex problems as algorithms.
使用流程图和"伪代码"表示算法, 来处理复杂问题
Complex problems are problems that would be difficult for students to solve computationally. Students should use pseudocode and/or flowcharts to organize and sequence an algorithm that addresses a complex problem, even though they may not actually program the solutions. For example, students might express an algorithm that produces a recommendation for purchasing sneakers based on inputs such as size, colors, brand, comfort, and cost. Testing the algorithm with a wide range of inputs and users allows students to refine their recommendation algorithm and to identify other inputs they may have initially excluded.
"复杂问题"是指学生很难通过计算来解决的问题. 学生即使还没有解决复杂问题的具体编程方案, 也能够使用"伪代码"[4]和"流程图"来组织解决这个问题的算法思路. 比如说, 学生可能会表达一种算法, 根据尺寸、颜色、品牌、舒适度和成本等输入信息, 来推荐购买运动鞋. 通过广泛的数据输入和用户反馈对算法进行测试, 使学生能够改进他们的推荐算法, 并找出他们最初可能忽略的其他影响参数
Algorithms
算法
4.4
4.1
2-AP-11 Create clearly named variables that represent different data types and perform operations on their values.
创建命名明确的变量, 用来表示不同的数据类型, 并且对变量的值进行操作
A variable is like a container with a name, in which the contents may change, but the name (identifier) does not. When planning and developing programs, students should decide when and how to declare and name new variables. Students should use naming conventions to improve program readability. Examples of operations include adding points to the score, combining user input with words to make a sentence, changing the size of a picture, or adding a name to a list of people.
"变量"就像有名字的容器, 变量里面的内容可以更改, 但是变量名称(也称为"标识符 identifier")不会改变. 在规划和开发程序时, 学生应该决定何时以及如何声明和命名新的变量. 学生应该使用共同约定的命名规则来提高程序的可读性. 比如说下面这些场景, 需要使用含义明确的变量名来提高可读性: 向分数值加分、将用户输入的内容和其他文字组合成一个句子、更改图片的大小、将一个名字添加到人员列表中.
Variables
变量
5.1
5.2
2-AP-12 Design and iteratively develop programs that combine control structures, including nested loops and compound conditionals.
设计并迭代开发结合"控制结构"的程序,包括嵌套循环和复合条件
Control structures can be combined in many ways. Nested loops are loops placed within loops. Compound conditionals combine two or more conditions in a logical relationship (e.g., using AND, OR, and NOT), and nesting conditionals within one another allows the result of one conditional to lead to another. For example, when programming an interactive story, students could use a compound conditional within a loop to unlock a door only if a character has a key AND is touching the door.
"控制结构"可以以多种方式组合. "嵌套循环"是指放在循环中的循环. "复合条件"是指在逻辑关系中, 结合了两个或者多个逻辑判断条件(比如, 使用 AND、OR、NOT 来连接不同的逻辑判断条件), 并且在条件语句中嵌套另一个条件语句, 允许一个条件的结果引向另一个条件. 比如说, 在编写一个交互式的故事时, 学生可以在循环语句中使用一个复合条件语句, 来实现"只有当一个角色有钥匙并且触摸门时, 才能打开门".
Control
控制
5.1
5.2
2-AP-13 Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.
将问题和子问题分解成若干个小部分, 以便于方案的设计、实现和检查
Students should break down problems into subproblems, which can be further broken down to smaller parts. Decomposition facilitates aspects of program development by allowing students to focus on one piece at a time (e.g., getting input from the user, processing the data, and displaying the result to the user). Decomposition also enables different students to work on different parts at the same time. For example, animations can be decomposed into multiple scenes, which can be developed independently.
学生应该把一个大问题分解成子问题, 这些子问题可以进一步再分解成更小的问题. 分解有利于程序开发的各个环节, 让学生一次只关注一个小问题(例如, 分解成类似"从用户那里获得输入、处理数据、向用户显示结果"的小问题). 分解还使不同的学生能够在同一时间处理不同的部分. 比如说, 动画可以分解成多个场景, 这些场景可以独立并行开发.
Modularity
模块化
3.2
2-AP-14 Create procedures with parameters to organize code and make it easier to reuse.
创建带有参数的程序, 来组织代码, 使其更容易复用
Students should create procedures and/or functions that are used multiple times within a program to repeat groups of instructions. These procedures can be generalized by defining parameters that create different outputs for a wide range of inputs. For example, a procedure to draw a circle involves many instructions, but all of them can be invoked with one instruction, such as "drawCircle." By adding a radius parameter, the user can easily draw circles of different sizes.
学生应该创建函数, 在程序中多次调用这些函数来重复执行一组指令. 通过定义参数来涵盖不同的过程, 通过参数接收不同的输入, 可以产生不同的输出. 比如说, 绘制圆形的过程包含很多指令, 但是所有这些指令都可以通过一条指令来调用, 比如定义一个 "drawCircle" 函数, 通过输入一个半径参数, 可以轻松地绘制出不同大小的圆.
Modularity
模块化
4.1
4.3
2-AP-15 Seek and incorporate feedback from team members and users to refine a solution that meets user needs.
收集并吸收团队成员和用户的反馈来完善解决方案, 以满足用户需求
Development teams that employ user-centered design create solutions (e.g., programs and devices) that can have a large societal impact, such as an app that allows people with speech difficulties to translate hard-tounderstand pronunciation into understandable language. Students should begin to seek diverse perspectives throughout the design process to improve their computational artifacts. Considerations of the end-user may include usability, accessibility, age-appropriate content, respectful language, user perspective, pronoun use, color contrast, and ease of use.
"以用户为中心"的开发团队, 所创造的解决方案(例如程序和电子设备), 可以对社会产生巨大影响, 比如一个可以让有语言障碍的人将难以理解的发音翻译成可理解的语言的应用程序, 学生应该开始寻求不同的观点, 来改善他们的产品. 需要考虑终端用户的因素包括可用性、可访问性、与用户年龄相符合的内容、尊重用户的语言、用户角度、指代名词的使用、颜色对比、易用性.
Program Development
编程开发
2.3
1.1
2-AP-16 Incorporate existing code, media, and libraries into original programs, and give attribution.
将他人成品的代码、媒体作品和库融入到程序中, 并注明所引用作品的原创者
Building on the work of others enables students to produce more interesting and powerful creations. Students should use portions of code, algorithms, and/or digital media in their own programs and websites. At this level, they may also import libraries and connect to web application program interfaces (APIs). For example, when creating a side-scrolling game, students may incorporate portions of code that create a realistic jump movement from another person's game, and they may also import Creative Commons-licensed images to use in the background. Students should give attribution to the original creators to acknowledge their contributions.
以他人的作品为基础, 使学生能够创作出更有趣、更有力的作品. 学生应该在自己的程序和网站中使用部分成品的代码、算法和数字媒体作品. 在这个学习阶段, 他们还可以导入库并连接到 web 应用程序的接口(API). 比如说, 当创建一个侧面滚动的游戏时, 学生可以将部分代码合并到另一个人的游戏中, 从而创建一个逼真的跳跃动作, 他们也可以导入"知识共享许可协议(Creative Commons-Licence)"的图像作为游戏背景. 学生应该注明引用作品的原创者, 以承认他们的贡献.
Program Development
编程开发
4.2
5.2
7.3
2-AP-17 Systematically test and refine programs using a range of test cases.
使用一系列"测试用例"[5]系统地测试和优化程序
Use cases and test cases are created and analyzed to better meet the needs of users and to evaluate whether programs function as intended. At this level, testing should become a deliberate process that is more iterative, systematic, and proactive than at lower levels. Students should begin to test programs by considering potential errors, such as what will happen if a user enters invalid input (e.g., negative numbers and 0 instead of positive numbers).
创建和分析用例和测试用例[5:1], 是为了更好地满足用户需求, 并评估程序是否按照预期的方式运行. 在这个学习阶段, "测试"应该成为一个深思熟虑的过程, 相比低层次的测试, 更加具有迭代性、系统性和主动性. 学生开始测试时, 应该考虑潜在可能发生的错误, 比如, 如果用户输入无效(例如, 要求输入正数, 但是用户输入负数和0)会发生什么.
Program Development
编程开发
6.1
2-AP-18 Distribute tasks and maintain a project timeline when collaboratively developing computational artifacts.
在合作开发计算机产品时, 分配任务并且保证项目的时间进度
Collaboration is a common and crucial practice in programming development. Often, many individuals and groups work on the interdependent parts of a project together. Students should assume pre-defined roles within their teams and manage the project workflow using structured timelines. With teacher guidance, they will begin to create collective goals, expectations, and equitable workloads. For example, students may divide the design stage of a game into planning the storyboard, flowchart, and different parts of the game mechanics. They can then distribute tasks and roles among members of the team and assign deadlines.
在编程开发中, 协作是一种常见而且至关重要的实践. 通常情况下, 许多个人和小组共同完成项目中相互依赖的部分. 学生应该在他们的团队中承担预先分配的角色, 并使用结构化的时间进度表来管理项目工作流程. 在老师的指导下, 他们将开始创建整体目标、整体期望和公平的工作量分配. 比如说, 学生可以将游戏的设计阶段划分为策划故事板、流程图和游戏机制等不同部分. 然后, 他们在团队成员之间分配任务和角色, 并制定完成任务的最后期限.
Program Development
编程开发
2.2
2-AP-19 Document programs in order to make them easier to follow, test, and debug.
在程序开发过程中记录文档, 以便于跟踪、测试和调试
Documentation allows creators and others to more easily use and understand a program. Students should provide documentation for end users that explains their artifacts and how they function. For example, students could provide a project overview and clear user instructions. They should also incorporate comments in their product and communicate their process using design documents, flowcharts, and presentations.
文档可以让开发者和其他人更容易地使用和理解程序. 学生应该为终端用户提供文档, 解释他们的产品以及产品的功能. 比如说, 学生可以提供项目概述和明确的用户说明, 他们还应该在产品中加入注释, 并使用设计文档、流程图和演示文稿来报告他们的开发过程.
Program Development
编程开发
7.2

# 计算机科技的影响

Impacts of Computing

序号 标准和描述 相关概念 实践
2-IC-20 Compare tradeoffs associated with computing technologies that affect people's everyday activities and career options.
对影响人们日常生活和职业选择的相关的计算机技术, 进行比较和利弊权衡
Advancements in computer technology are neither wholly positive nor negative. However, the ways that people use computing technologies have tradeoffs. Students should consider current events related to broad ideas, including privacy, communication, and automation. For example, driverless cars can increase convenience and reduce accidents, but they are also susceptible to hacking. The emerging industry will reduce the number of taxi and shared-ride drivers, but will create more software engineering and cybersecurity jobs.
计算机技术进步带来的影响既不完全是正面的, 也不完全是负面的. 人们使用计算机技术的方式应该有所取舍. 学生考虑时事时应该纳入更广泛的观点, 包括隐私、交流和自动化. 比如说, 无人驾驶汽车可以提高便利减少事故, 但是它们也容易受到黑客攻击. 这个新兴产业将减少出租车和共享司机的数量, 但也会创造更多的软件工程和网络安全的岗位
Culture
文化
7.2
2-IC-21 Discuss issues of bias and accessibility in the design of existing technologies.
讨论现有技术设计中的偏见和可访问性的问题
Students should test and discuss the usability of various technology tools (e.g., apps, games, and devices) with the teacher's guidance. For example, facial recognition software that works better for lighter skin tones was likely developed with a homogeneous testing group and could be improved by sampling a more diverse population. When discussing accessibility, students may notice that allowing a user to change font sizes and colors will not only make an interface usable for people with low vision but also benefits users in various situations, such as in bright daylight or a dark room.
在老师的指导下, 学生应该测试和讨论各种科技工具(比如应用程序、游戏、电子设备)的可用性. 比如说, 一款面部识别软件, 能够更好地识别肤色较浅的人, 这意味着它可能是在同质化的测试群体中开发的. 那么可以通过更多样化的抽样来提高其更广泛的可用性. 在讨论可用性时, 学生可能会注意到, 允许用户更改程序界面的字体大小和颜色, 不仅有利于低视力用户的使用, 也能够让其他各种各样的用户受益, 比如, 在明亮的日光下或者在黑暗的房间里, 用户可以通过改变字体大小和颜色获得更好的观感
Culture
文化
1.2
2-IC-22 Collaborate with many contributors through strategies such as crowdsourcing or surveys when creating a computational artifact.
在创造产品时, 通过众包或者调查等策略, 来和众多贡献者合作.
Crowdsourcing is gathering services, ideas, or content from a large group of people, especially from the online community. It can be done at the local level (e.g., classroom or school) or global level (e.g., ageappropriate online communities, like Scratch and Minecraft). For example, a group of students could combine animations to create a digital community mosaic. They could also solicit feedback from many people though use of online communities and electronic surveys.
"众包"是指从一大群人, 尤其是从线上社区中收集服务、想法或内容. 它可以在地区层面(例如教室或学校)或者全球层面(例如 Scratch 和 Minecraft 这样的适龄的在线社区)完成. 比如说, 一组学生可以结合动画, 创建一个数字社区的马赛克(digital community mosaic). 他们还可以通过使用线上社区和电子调查, 来获得更多人的反馈
Social Interactions
社交互动
2.4
5.2
2-IC-23 Describe tradeoffs between allowing information to be public and keeping information private and secure.
在允许信息公开和保证信息私密性安全性之间进行权衡
Sharing information online can help establish, maintain, and strengthen connections between people. For example, it allows artists and designers to display their talents and reach a broad audience. However, security attacks often start with personal information that is publicly available online. Social engineering is based on tricking people into revealing sensitive information and can be thwarted by being wary of attacks, such as phishing and spoofing.
在网上分享信息可以帮助建立、维护和加强人与人之间的联系. 比如说, 它允许艺术家和设计师展示他们的才华, 并接触到广泛的观众. 然而, 安全攻击往往始于网上公开的个人信息. "社会工程学"的基础是欺骗人们透露出敏感信息, 不过, 只要警惕网络钓鱼和欺骗等, 就可以阻止这类安全攻击.
Safety Law & Ethics
法律 & 道德
7.2

  1. "不插电的计算机科学"是指不需要使用计算机, 而是在游戏活动中学习计算机科学. 在国外有专门的网站讲解这个主题 -- https://csunplugged.org (opens new window)https://code.org/curriculum/unplugged (opens new window) ↩︎

  2. "位"是度量数据大小的单位. 我们回想一下日常的电脑操作. 在查看文件大小时, 通常标注了"xxx 字节"或者"xxx KB". 这里的"字节"和"KB"和我们要说的"位"都是文件大小的度量单位. 在计算机内部, 信息是按照二进制的形式存储的. 二进制数中存储的一个数位, 也就是 0 或者 1, 就称为 1 位(bit). 而每 8 位称为 1 个字节(Byte, B). 而 KB 就表示"Kilo-byte", 也就是一千个字节、8000 位 ↩︎

  3. RGB 是"Red Green Blue"三原色的缩写, 是一种颜色标准, 通过红绿蓝三个颜色的变化和叠加来表示所有颜色 ↩︎

  4. "伪代码 (pseudo-code)": 是指模仿代码的形式来描述程序的运行逻辑, 但是使用的是符合人类阅读习惯的写法, 而不是真正的编程语言. 也就是说, 伪代码只能用来描述思路, 但是不能用来运行. 它的目的是辅助算法设计阶段的思考, 因为在这个阶段, 需要关注的是思路, 而不是具体实现. 而“伪代码”可以让我们不用纠结于具体的代码实现. 下面是一个例子:

    function 求最大值(a, b)
        如果 a >= b
            a → 最大
        否则
            b → 最大    
    
    1
    2
    3
    4
    5
    ↩︎
  5. "测试用例(Test Case)"是计算机行业的术语, 表示一个完整的测试过程, 包括如何设置测试环境、操作的过程、预期的结果 ↩︎ ↩︎