He took some very drastic actions of firing the whole police force and recreating it from scratch.
VOA: standard.2009.09.01
It'll allow you to tackle interesting problems I'll have you to write from scratch, but it does mean that this skill here is going to be really valuable.
它会让你处理有趣的问题,我会让你绞尽脑汁的编写,但是这一点意味着,这个技能非常宝贵。
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.
它一般被称作分布码,然而,对于之前几乎要从头做起的问题,在空白文件中什么都没有,除非你在里面写入些东西。
Take the fattest marking pen you have, scratch that out and replace it with atomic hydrogen.
用你最粗的笔把它划掉,再用氢原子代替它。
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?
所以我们要做的第一件事,就是抓抓脑袋看看发生了什么,好了,让我们来看看,这儿发生了什么呢?
Thus far and in Scratch will pretty much focus on the idea of correctness: Does your code work as we asked it to and as you intended it to?
至此,人们大都是把注意力集中于正确性,观点上:你的代码是不是根据你的意愿,并按照你的要求来执行呢?
But for the next week or two when you're writing programs, at least for the first time, generally if you're trying Scratch to debug them like you might have been trying to troubleshoot Scratch, you're probably going to reason - through it by looking through the your code -- -- top to bottom, maybe engage a staff member for help -- but your friend will also be printf.
但是,在接下来的一两周内,当你们写程序的时候,或至少在第一次写的时候,通常如果你在调试程序,就像你们可能已经试着调试过,你们或许是通过查看你们的代码,来推断你们的程序-,从头到尾,可能还需要别人的帮忙-,但是你的朋友也将要打印输出。
Well, that program was interesting because it had an inventory which was implemented in Scratch with a list which is kind of like a container that you can add things to again and again.
那个程序很有趣,它有一个用Scratch做出来的清单,还有一个貌似容器的列表,你可以不断往里面加东西。
We've seen this branching construct in Scratch, we've seen it a moment ago on the slide, and see, we just need else if to use not an else, not just an if but an else if.
我们看到了这个Scratch的分支结构,我们看到刚才在幻灯片中,了解到,我们不需要,用一个else,也不只是用一个if,而是用一个。
And notice, unlike Scratch where some of you might have realized it starts to get a little ugly, you have an "if else" and then you have another here and another one and things start to move and move and move like this, it gets very messy.
请注意,不像Scratch,在那里,你们其中某些人可能认识到它变得有点丑,你有一个“if,else“然后这里又另一个,那里又有一个,代码就像这样开始跳转,跳转再跳转,它开始变得有点凌乱了。
When you created a variable in scratch, you could either make it for this sprite only or for all sprites. All right.
当你在scratch中创建一个变量,你可以只为这个精灵创建,或者为全部的精灵而创建,好的。
> So this tune made by one of our former students; but it doesn't have to be something written in Scratch, it doesn't have to be a game or animation it can simply be an incredibly, wonderfully way to spend time.
这段是由以前的学生制作的;,不一定非要用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 odds are if a week hence, two weeks hence just for fun you decide to reimplement your Scratch project -- or some tiny piece of it, it wouldn't be surprising -- or shouldn't be -- if you end of implementing the same game or animation or whatever using a completely different set of puzzle pieces Same deal we'd see here.
可能一周之后,两周之后,为了好玩,你决定重新实现你的Scrtch工程,或者其中一小部分,它将不会是令人惊讶的-,本来也不应该是--如果你运行相同的游戏,或者是动画,亦或是用完全不同的设置,来运行拼图游戏,我们将看到相同的处理。
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做出来的游戏,并无区别。
应用推荐