So it's generally called distribution code and whereas for the previous problems that you pretty much started from scratch, blank files you opened up nano and there was nothing there unless you put it there.
它一般被称作分布码,然而,对于之前几乎要从头做起的问题,在空白文件中什么都没有,除非你在里面写入些东西。
So first thing we should do is scratch our heads and see what's going on here. Alright, let's look at it. What's happening here?
所以我们要做的第一件事,就是抓抓脑袋看看发生了什么,好了,让我们来看看,这儿发生了什么呢?
Let's actually put this into play with the little sprite known as scratch.
让我们把这个用到那个,我们熟知的小精灵当中。
In Scratch you may have realized that, "I could implement my program this way with these puzzle pieces, but it kind of feels -- like I could use these puzzle pieces instead" -- that's absolutely the case in programming.
在Scratch中你可能已经意识到,“我可以用这一段代码来,执行我的程序,不过这有点感觉到,我可以用这些代码段来代替“,那绝对是编程中的一个情况。
And you will see over time as you've seen with Scratch that there's going to be different ways to implement these various goals.
久而久之你们也将看到像你们在Scratch上看到的一样,它们有不同的方式,来实施不同的目的。
There's no notion of naming a script as you can a function in scratch.
这里没有一个命名一个脚本的概念,而你可以在scratch中命名一个函数。
We'll see they're not quite as versatile as Scratch's little inventory capability.
它们并不像Scratch里的“清单“,那么的多功能化。
> So this was a Scratch project submitted by one of last year's students.
>,这是由去年一个学生完成的,一个Scratch项目。
So unlike Scratch where you pretty much had to say "repeat" ten times or whatever, or forever where it's just "forever" with for loops, -- can you actually specify a finite number of iterations -- and as I learned 15 years ago, finite is important.
所以不像Scratch,你大致上需要用,“repeat“10次或更多,或者需要不断地使用当它,是死循环时,你们能够指定出一个有限的迭代次数-,像我15年前学的,有穷的是重要的。
And it's also much more similarly structured to Scratch.
而且这个对于Scratch来说是也是更有结构性的。
But what looks like this orange block as of now in Scratch, add orange to your so called inventory, well, it's gonna take at least two lines of code in C to actually create the inventory array with this first line and then put something like the word orange inside of it.
就好比Scratch里面橘色的这一块,把“桔子“加到所谓的“清单“里面去,在C语言中至少需要两行代码来实现,第一行代码创建一个货单数组,第二行就需要把“桔子“放进去。
But at the end of the day, the point of the slides is not to expect you to now go write programs in C but really to just remind you that, hey, if you ever get distracted from some of the minutia that is the semicolons, parentheses, and what is very new to many of you, it's really no different than the fun and games we implemented with Scratch last week.
但是最终,我们课件上讨论的主题,并不是让你现在就写一个C语言的程序,而是要告诉大家不要你被那些分号括号,还有一些从未见过的符号等一些细节搅得心烦意乱,因为它们本质上,和我们上周用Scratch做出来的游戏,并无区别。
应用推荐