Skip to content

Commit febb663

Browse files
committed
feat: update chapter(s) by CAT
1 parent f8daec6 commit febb663

File tree

4 files changed

+82
-4
lines changed

4 files changed

+82
-4
lines changed

content/chapter-10/1000.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
idxx: 2
2+
id: 16
33
title: "[译] [1000] 第十章 开发小游戏"
44
---
55

@@ -13,10 +13,20 @@ title: "[译] [1000] 第十章 开发小游戏"
1313
* Designing and programming a code-breaking logic game
1414
* Designing and programming a press-your-luck dice game
1515

16+
<!-- -->
17+
18+
* 在我们的程序中加入随机性
19+
* 设计并编程一个破解代码的逻辑游戏
20+
* 设计并编程一个冒险掷骰子游戏
21+
1622
There are many reasons why people learn to program. Some people want to automate tedious tasks as we did in the previous chapter. Some people want to work with artificial intelligence as we did in Chapter 7. Other people want to make interactive websites, Android or iOS apps, or Alexa skills. There’s an endless amount of stuff that programmers can make.
1723

24+
人们学习编程的理由千差万别。一些人希望能够像我们在上一章展示的那样,自动化那些重复性的任务。有些人则是想要像在第七章中那样,与人工智能进行合作。还有人愿意制作交互式网站、Android 或 iOS 应用程序,或是 Alexa 技能。程序员能够创造的东西实在是无穷无尽。
25+
1826
Another popular reason to learn programming is to create games. For that reason, we thought we’d end our Copilot programming journey with you by designing two small computer games. The first is a code-breaking game where you use clues to identify the computer’s secret number. The second is a two-player dice game where each player needs to balance risk and luck to reach the required number of points before the other player does. Instead of using graphics and animation, these games use text. We’ve made this decision to help us stay focused on the game logic, rather than the way that the game is represented or the way that the player interacts with the games. Along the way, we offer some next steps if you are interested in taking your game-making abilities further. And don’t worry, your current skills are a great start to that!
1927

28+
创造游戏是学习编程的另一个广受欢迎的原因。因此,我们打算通过设计两款小型计算机游戏,为你的 Copilot 编程之旅画上圆满的句号。第一款游戏是破解密码,通过线索揭开计算机隐藏的秘密数字。第二款是双人骰子游戏,玩家需要在对方之前,巧妙地权衡风险和运气以达到既定分数。选择文本而非图形和动画来展现这些游戏,是为了让我们能集中精力探讨游戏逻辑,而非游戏的视觉表现或是玩家的互动方式。如果你对提升游戏制作技能感兴趣,我们也会提供一些可能的后续步骤。不过,别担心,你目前所拥有的技能已经为此打下了良好的基础!
29+
2030
***
2131

2232
* 10.1 Game programs
@@ -31,3 +41,18 @@ Another popular reason to learn programming is to create games. For that reason,
3141
* 10.4.1 How the game works
3242
* 10.4.2 Top-down design
3343
* 10.4.3 Implementing our functions
44+
45+
<!-- -->
46+
47+
10.1 游戏程序设计
48+
10.2 加入随机性
49+
10.3 示例一:公牛与奶牛游戏
50+
10.3.1 游戏的运行机制
51+
10.3.2 采用自顶向下的设计策略
52+
10.3.3 参数及返回值的类型
53+
10.3.4 实施我们的功能
54+
10.3.5 为公牛与奶牛游戏增加图形化界面
55+
10.4 示例二:Bogart 游戏
56+
10.4.1 游戏的运行机制
57+
10.4.2 采用自顶向下的设计策略
58+
10.4.3 实施我们的功能

content/chapter-11/1100.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
idxx: 2
2+
id: 17
33
title: "[译] [1100] 第十一章 展望未来"
44
---
55

@@ -12,8 +12,16 @@ title: "[译] [1100] 第十一章 展望未来"
1212
* Using prompt patterns to write and explain code
1313
* Current limitations and future directions of generative AI tools
1414

15+
<!-- -->
16+
17+
* 应用提示词模式编写与解释代码
18+
* 生成式 AI 工具的现状限制及未来发展趋势
19+
20+
1521
In this final chapter, we want to give you a glimpse of the creative ways people are currently using generative AI tools like GitHub Copilot and ChatGPT. For example, it’s possible to make Copilot Chat ask you the questions, rather than the other way around. And it’s possible to make Copilot take on a different persona to be even more helpful to your current programming task. We’re going to keep this brief, and it’s not clear how much of this will become standard practice, but we want to take this opportunity to demonstrate the power of being creative with these new tools. We’ll also talk about some of the current limitations of generative AI tools (you’ve seen some of them already in this book!) and offer our thoughts on what may be next.
1622

23+
在本书的终章,我们期望展示人们当前如何创造性地使用生成式 AI 工具,例如 GitHub Copilot 和 ChatGPT。比如,可以实现让 Copilot Chat 主动提出问题,而非单向交流。更进一步,还能让 Copilot 采取不同的身份,以便更好地适应你的编程任务。我们将保持简洁,尽管现在还不确定这些方法会在何种程度上成为常规操作,但我们希望借此机会展现出利用这些新工具进行创造性思维的潜力。此外,我们还将讨论生成式 AI 工具目前的一些限制(本书中已有所涉及),并就可能的未来趋势提供我们的见解。
24+
1725
***
1826

1927
* 11.1 Prompt patterns
@@ -22,3 +30,12 @@ In this final chapter, we want to give you a glimpse of the creative ways people
2230
* 11.2 Limitations and future directions
2331
* 11.2.1 Where Copilot (currently) struggles
2432
* 11.2.2 Is Copilot a new programming language?
33+
34+
<!-- -->
35+
36+
11.1 提示词模式
37+
11.1.1 翻转互动模式
38+
11.1.2 角色推演模式
39+
11.2 局限与未来走向
40+
11.2.1 Copilot 目前遇到的挑战
41+
11.2.2 Copilot 能被视为一种新的编程语言吗?

content/chapter-8/800.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ The good news is that having an error in your code is such a common occurrence f
3535

3636
...
3737

38+
...
39+
3840
***
3941

4042
* 8.1 What causes errors (bugs)?

content/chapter-9/900.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
idxx: 2
2+
id: 15
33
title: "[译] [900] 第九章 繁琐事务自动化"
44
---
55

@@ -11,18 +11,37 @@ title: "[译] [900] 第九章 繁琐事务自动化"
1111

1212
* Understanding why programmers write tools
1313
* Determining which modules we need to write a given tool
14-
* Automating cleaning up emails that have > > > symbols
14+
* Automating cleaning up emails that have `> > >` symbols
1515
* Automating manipulating PDF files
1616
* Organizing your and your partner’s phone pictures in the same place
1717

18+
<!-- -->
19+
20+
* 探讨程序员编写工具的动机
21+
* 确定编写特定工具需要哪些模块
22+
* 自动清除含有 `> > >` 符号的电子邮件
23+
* 对 PDF 文件进行自动化操作
24+
* 把你及你伙伴的手机照片统一整理至同一位置
25+
26+
1827
Suppose that you’re responsible for creating 100 reports, one for each of 100 people. Perhaps you’re a teacher and need to send a report to each of your students. Perhaps you work for HR and need to send an annual assessment report to each employee. Regardless of your role, you have the problem of having to create these reports, and you decided to prepare your reports as .pdf files. You need a customized cover page for each report, too, and those cover pages are designed by one of your colleagues (a graphic design artist).
1928

29+
假设你需要制作 100 份报告,每个人分得一份。可能你是教师,需要向每位学生发送一份报告;或者你在人力资源部门,需要向每位员工发送年度评估报告。不论你担任何种角色,你都将面临制作这些报告的挑战,并且你决定以 .pdf 格式来准备这些报告。每份报告还需一个个性化的封面,这些封面由你的一位同事——一位平面设计艺术家——设计。
30+
2031
You and your colleague work independently, and finally, the job is done. Or wait, not so fast. Because now you have to put each cover page at the beginning of each of your reports.
2132

33+
你和你的同事分头工作,终于,任务完成了。但是,别急。因为现在你必须把每个封面页添加到每份报告的最前面。
34+
2235
At this point, a non-programmer might grit their teeth and start on the job, manually merging the cover page with the first report, the second cover page with the second report, and so on. That could take hours. Not knowing that there may be another way, a non-programmer may just power ahead until the job is done.
2336

37+
此刻,非程序员可能只能硬着头皮开始工作,手动将每个封面与相应的报告一一合并,从第一个封面和报告开始,如此下去。这样的工作可能需要耗费数小时。由于不知道还有其他解决办法,非程序员可能只会坚持到底,直至任务完成。
38+
2439
But you’re a programmer now. And most programmers, the two of us included, would never power ahead with manual work like this.
2540

41+
然而,你现在是一名程序员。包括我们自己在内的绝大多数程序员,都不会选择坚持这种手动重复的工作。
42+
43+
...
44+
2645
...
2746

2847
***
@@ -39,3 +58,18 @@ But you’re a programmer now. And most programmers, the two of us included, wou
3958
* 9.5.1 Conversing with Copilot
4059
* 9.5.2 Top-down design
4160
* 9.5.3 Writing the tool
61+
62+
<!-- -->
63+
64+
9.1 程序员为什么创造工具
65+
9.2 如何使用 Copilot 编写工具
66+
9.3 示例一:电子邮件文本的清理
67+
9.3.1 与 Copilot 对话
68+
9.3.2 制作工具
69+
9.4 示例二:给 PDF 文件增加封面页
70+
9.4.1 与 Copilot 对话
71+
9.4.2 制作工具
72+
9.5 示例三:合并手机照片库
73+
9.5.1 与 Copilot 对话
74+
9.5.2 自顶向下的设计
75+
9.5.3 制作工具

0 commit comments

Comments
 (0)