So really, once we start writing more interesting programs, you would have to type out long annoying commands like that to just compile more sophisticated programs.
实际上,一旦我们开始写一些更复杂的程序时,你们可能要键入那样一些长的,讨厌的命令,来编译跟高级的程序。
I start off, either I take this path and carry on, or I take that path and carry on, but each box, if you like, gets touched exactly once.
程序开始后,或者采取这条路径然后继续,或者采取那条路径然后继续,但是每个图形,如果你喜欢这么说的话。
So let's go ahead and introduce a couple other capabilities so that we can finally start writing programs that maybe print out charts or interact with the user, play games, or the like.
让我们继续来介绍其他几个功能,以便我们最终能开始写程序,那样可以打印图表或与用户交互,打游戏之类的。
Take your time. So, let's actually now take a 2-minute break, we're gonna change tapes and we'll come back and we'll actually write programs with a real computer and some real animated characters.
不急,现在休息2分钟,我们要换个录像带,一会再上课,等会开始写程序,构建一些动画人物。
Now just to get used to the conventions, 0 because this is the program you'll use not for problems at 0 but for 1 to start writing programs, notice at the top in this window just reminds you what you're working on.
我们要入乡随俗,习惯这样的界面,因为这是你们将要用到的程序,不是为习题集0,而是0,而是为习题集1开始写程序的,注意窗口顶部,这是用来提醒你,你工作在何种环境。
The last point I want to make to you is, you've started writing programs that you would think of as being inherently iterative.
能反映递归特性的程序,我最后一点想说的是,你已经开始编写你认为。
OK, here we go, here we go, you see, I'm doing it down here, I can't see it, does that-- ah, I hear his sighs of relief, OK, good. There we go. Better. All right.
好,我们开始,大家可以看到,我在这里写这个程序,我看不见,这是不是-啊,我听到大家放松的叹气了,好,让我们开始吧,好多了,好。
Alright, so maybe a little underwhelming and we saw already what this program is going to do but let's just go through this process once before we start doing more interesting things and then we'll come back and at least give you a hint of what some of these syntactic details are doing.
好吧,这个程序也许太平庸了,让人印象不够深刻,我们也知道这个程序是干嘛的,在我们开始更有意思的事情之前,让我们再来讨论一下整个过程后再回来,这些语法细节到底是在做什么呢?,先给你们一点小小的提示。
We'd expect you to write now or perhaps ever since this program was written as part of an obfuscated C contest.
我希望你们现在就开始写程序,否则你们将会在C语言比赛中,写得非常糟糕。
All right, so let's take things up slightly to a more interesting one.
好的,让我们开始学习一个稍微,更有趣点的程序。
So I start this program by declaring as I did before a global variable X. It is global simply because it is not inside any of my functions.
在程序的开始,我声明,一个全局变量X,它是一个全局的,因为它不在任何一个函数里面。
The point I'm trying to make is, fixed-program computers is where we started, but it doesn't really get us to where we'd like to be.
我要指出的一点是,我们从固定程序计算机开始说起,但它并不能让我们到达我们想去的地方。
So the way to think about this in terms of flow is, it starts with that if and it says, check both of those things.
因此用控制流的方式,来考虑这件事就是,程序由if开始,然后要对两件事情,都进行检查。
And then really the fun begins when you realize all you have ; to do is now start wiring these ideas together; wiring these little bite size problems together and so in the end that actually make, per Tej's project, a really impressive whole.
当你意识到你现在要做的就是,把想法付诸程序,把小问题串连到一起的时候;,就开始觉得有意思了,实际上每个Tej的项目,都是个为令人印象深刻的整体。
应用推荐