Skip to content

Commit a9bbcf3

Browse files
committed
feat: add raw chapter(s)
1 parent 707aa8d commit a9bbcf3

File tree

28 files changed

+2507
-3
lines changed

28 files changed

+2507
-3
lines changed

content/chapter-1/100.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ title: "[译] [100] 第一章 走近 AI 辅助编程"
44
tags: [Revised, "Need Review"]
55
---
66

7-
# Introducing AI-Assisted Programming with Copilot
8-
7+
# 1 Introducing AI-Assisted Programming with Copilot
98
# 第一章 走近 AI 辅助编程
109

1110
### This chapter covers
12-
1311
### 本章内容概要
1412

1513
* AI-assisted computer programming

content/chapter-10/1000.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
idxx: 2
3+
title: "[译] [1000] 第十章 开发小游戏"
4+
---
5+
6+
# 10 Making Some Games
7+
# 第十章 开发小游戏
8+
9+
### This chapter covers
10+
### 本章内容概要
11+
12+
* Adding randomness to our programs
13+
* Designing and programming a code-breaking logic game
14+
* Designing and programming a press-your-luck dice game
15+
16+
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.
17+
18+
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!
19+
20+
***
21+
22+
* 10.1 Game programs
23+
* 10.2 Adding randomness
24+
* 10.3 Example 1: Bulls and Cows
25+
* 10.3.1 How the game works
26+
* 10.3.2 Top-down design
27+
* 10.3.3 Parameters and return types
28+
* 10.3.4 Implementing our functions
29+
* 10.3.5 Adding a graphical interface for Bulls and Cows
30+
* 10.4 Example 2: Bogart
31+
* 10.4.1 How the game works
32+
* 10.4.2 Top-down design
33+
* 10.4.3 Implementing our functions

content/chapter-11/1100.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
idxx: 2
3+
title: "[译] [1100] 第十一章 展望未来"
4+
---
5+
6+
# 11 Future Directions
7+
# 第十一章 展望未来
8+
9+
### This chapter covers
10+
### 本章内容概要
11+
12+
* Using prompt patterns to write and explain code
13+
* Current limitations and future directions of generative AI tools
14+
15+
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.
16+
17+
***
18+
19+
* 11.1 Prompt patterns
20+
* 11.1.1 Flipped interaction pattern
21+
* 11.1.2 Persona pattern
22+
* 11.2 Limitations and future directions
23+
* 11.2.1 Where Copilot (currently) struggles
24+
* 11.2.2 Is Copilot a new programming language?

content/chapter-2/200.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
idxx: 2
3+
title: "[译] [200] 第二章 快速上手 Copilot"
4+
---
5+
6+
# 2 Getting Started with Copilot
7+
# 第二章 快速上手 Copilot
8+
9+
### This chapter covers
10+
### 本章内容概要
11+
12+
* Setting up Python, VS Code, and Copilot on your system
13+
* Introducing the Copilot design process
14+
* Copilot’s value for a basic data processing task
15+
16+
This chapter will help you start working with Copilot on your own machine and familiarize you with how to interact with it. After you are set up with Copilot, we’ll ask that you follow along with our examples when you can. There’s no substitute for practice, and we believe you can learn right alongside us for the remainder of the book.
17+
18+
Once you’ve set up Copilot, we’ll walk through a fun example that showcases the power of Copilot in solving standard tasks, you’ll see how to interact with Copilot, and you’ll learn how we can write software without writing any actual code ourselves.

content/chapter-2/210.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
idxx: 2
3+
title: "[译] [XXX] XXXXXXXXXXXXXXXX"
4+
---
5+
6+
7+
## 2.1 Time to setup your computer to keep learning
8+
9+
Learning how to write software requires that you perform the task of actually writing software, not just reading about it. If this were a book on how to play guitar, would you keep reading it without ever trying to play the guitar? We thought not. Reading this book without following along and trying it out yourself would be like watching a marathon runner finish the race and thinking you’re ready to go run one yourself. We’ll stop with the analogies, but seriously, you need to get your software installed and running before we go farther.
10+
11+
What scares us the most right now is that we just hit the most common point where novices, even those eager to learn programming, tend to fail, and we _really_ want to see you succeed. Now, you might be thinking, “Wait, really? We’re just getting started.” Yes, that’s exactly the point. In Leo’s popular Coursera course about learning Java programming \[1\], can you guess the point when most new leaners leave? Is it the challenging assignment that involves plotting earthquake markers on the globe in real time at the end of the course? No. It’s actually the warmup assignment where the learners must set up their programming environment. As such, we understand this could be a hurdle for you. We hope that with this not-so-subtle nudge, we can help you achieve all the goals you had in mind when you bought this book. It all starts with installing the software.
12+
13+
### 2.1.1 Overview of the software in your programming environment
14+
15+
To set up and use Copilot easily, we’ll be installing the software editing tools used by novices and software engineers alike. The tools you will be using are GitHub, Copilot, Python, and Visual Studio Code. Of course, if you already have all these tools installed, jump to section “Our first programming problem” later in this chapter.
16+
17+
#### GitHub Account
18+
19+
GitHub is an industry standard tool for developing, maintaining, and storing software. We won’t be using GitHub in this book, however. We’re signing up for GitHub simply because you’ll need an account to get access to Copilot.
20+
21+
Signing up for a GitHub account is free but, at the time of writing, they charge for Copilot. If you are a student, they will waive that fee. If you aren’t a student, as of writing, you can get a 30-day free trial.
22+
23+
You might ask why they charge for the service, and there’s a good answer. It’s expensive to build the GPT3 models (imagine thousands of computers running for a year to build the model) and there are costs they incur by providing predictions from the model (many machines are receiving your input, running it through the model, and generating your output). If you are not ready to commit to using Copilot, you could make a calendar note for roughly 25 days from the day you sign up and if you aren’t using Copilot at that time, just cancel. If, on the other hand, you have succeeded in learning how to write software with Copilot and are using it to improve your productivity at work or just as a hobby, keep it.
24+
25+
#### Python
26+
27+
Really any programming language would have worked for this book, but we picked Python because it is one of the most popular programming languages in the world and is the language we teach in our introductory courses at our universities. As we said in Chapter 1, compared to other languages Python is easier to read, easier to understand, and easier to write. For this book, Copilot will primarily be generating the code, not you. However, you will want to be able to read and understand the code generated by Copilot and Python is great for that.
28+
29+
#### Visual Studio Code (VSCode)
30+
31+
You can use any text editor to program. However, if you want a nice programming environment where you can write code, easily get suggestions from Copilot, and run your code, VSCode is our preferred tool. VSCode is used by novices learning software and is well liked by students \[2\]. It’s also used globally by professional software engineers, which means you’ll be able to work and learn while using this environment after finishing the book.
32+
33+
For VSCode to work for this book, you’ll need to install a few extensions that enable working with Python and using Copilot, but one of the great things about VSCode is that it makes it easy to install those extensions.

content/chapter-2/220.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
idxx: 2
3+
title: "[译] [XXX] XXXXXXXXXXXXXXXX"
4+
---
5+
6+
7+
## 2.2 Getting your system setup
8+
9+
This is actually a four-step process. To streamline this chapter, we’re just providing the main steps for this process below. However, there are more detailed instructions available in the following locations:
10+
11+
![](chapter-2.files/chapter-25488.png)GitHub’s documentation: https://docs.github.com/en/copilot/getting-started-with-github-copilot
12+
13+
![](chapter-2.files/chapter-25585.png)In the appendix of this book, there are detailed instructions for setting up your system for both PC and MacOS. As these websites might change after we write this book, we encourage you to use a combination of the link above and the appendix together.
14+
15+
![](chapter-2.files/chapter-25839.png)In the online book forum, you can ask for help and see a list of answers to frequently asked questions.
16+
17+
The primary steps you’ll need to accomplish are as follows:
18+
19+
#### 1. Set up your GitHub account and sign up for Copilot
20+
21+
a. Go to GitHub.com and sign up for a GitHub account: https://github.com/signup
22+
23+
b. Go into your settings in GitHub and enable Copilot. This is the point where you’ll either need to verify you are a student or sign up for the 30-day free trial (available at the time of writing).
24+
25+
#### 2. Install Python
26+
27+
a. Go to the website, [www.Python.org/downloads/](http://www.Python.org/downloads/)
28+
29+
b. Download and install the latest version of Python (3.11.1 at the time of writing).
30+
31+
#### 3. Install Visual Studio Code
32+
33+
a. Go to the website, https://code.visualstudio.com/Download, Select the main download for your Operating System (e.g., Windows Download or Mac Download).
34+
35+
b. Download and install the latest version of Visual Studio Code.
36+
37+
#### 4. Install Visual Studio Code Extensions (please read through https://code.visualstudio.com/docs/editor/extension-marketplace for details)
38+
39+
a. Python (by Microsoft). Follow the instructions at https://code.visualstudio.com/docs/languages/python to set up the Python extension correctly (specifically selecting the correct interpreter).
40+
41+
b. GitHub Copilot (by GitHub)
42+
43+
c. GitHub Copilot Labs (by GitHub). Note that Copilot Labs is not needed for the majority of the book, so if you encounter a waiting list or it has changed from the time of writing, please do not be discouraged.
44+
45+
We know that the steps here are brief, if you encounter any issues, we encourage you to consult the resources mentioned earlier for more detailed setup instructions.

0 commit comments

Comments
 (0)