• So I take 2 plus 3 b steps to go through this loop OK. So if b is 300, it takes 902 steps.

    好,如果b是300的话就是902步,如果b是3000那就有9002步。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • We start with j pointing here, and we can see what this loop's going to do, right? j is just going to move up.

    我们让j指向这里,我们能看到这个,循环要做什么?,对吧,j要开始移动了。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Condition," this thing in the middle between the semicolons, is going to be checked every iteration of the loop.

    条件,“这个在两个分号的中间,它将迭代地检查这个循环的条件。

    哈佛公开课 - 计算机科学课程节选

  • This is a highly simplified version, but sort of closes the loop on what we've been talking about.

    以上是对整个过程的高度概括,但它涵盖了我们讲过的内容

    耶鲁公开课 - 生物医学工程探索课程节选

  • So we'll loop back to this in just a moment, but start by going back earlier in history.

    我们稍后会回来继续讨论,先让我们回到早些时候

    耶鲁公开课 - 关于食物的心理学、生物学和政治学课程节选

  • All right, you can see that this little piece of code, it's got a loop in there, and what's it doing?

    好,你们看到的这一小块代码,是做了一个循环吧?,他在做什么?

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • We're gonna have a so called a loop, an infinite loop and you actually experience this in the real world.

    我们将会做一个循环,一个无限循环,你会在这个,真实世界里体验它。

    哈佛公开课 - 计算机科学课程节选

  • Well, let's take a look at this high7 variant that also use loops that also uses a loop. So this one is a little cute, I like to think. So notice this.

    让我们看下这个仍然使用了循环的版本,这个有点意思,我认为,注意这个。

    哈佛公开课 - 计算机科学课程节选

  • If we weren't so pressed for time, I kinda wanna see how long we could get away with this before it gets awkward, but that, in fact, is an infinite loop t hat's hopefully deliberate.

    如果有时间,我想看看,我们需要花多长时间解决这一问题,事实上,它是我故意,使用的无穷循环。

    哈佛公开课 - 计算机科学课程节选

  • And what's this little loop say to do? This little loop says I'm going to write a function or procedures that takes in two messages.

    这个小循环是做什么的,这个小的循环是,我要写一个函数或者过程来接受两条消息。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • By two, by two, by two, and here it just conceptually is why this thing doesn't infinitely loop.

    除以2,除以2,除以2,这里只是概念性地说明这一,过程为何不会无限循环。

    哈佛公开课 - 计算机科学课程节选

  • And as soon as this condition or these conditions evaluate to false, the whole loop terminates.

    一旦这个条件或这些条件不成立,整个循环终止。

    哈佛公开课 - 计算机科学课程节选

  • Once you know what pieces to look for, what mental constructs to reach for, can you realize all right I want to make some dancing figures go back and forth, I need to loop this way and loop this way and check if I'm on the edge and so forth.

    一旦确定需要查找的部分,想要达到那种层次,你是否意识到,我想做出一些可以来回走动跳舞的人,我需要按这种方式那种方式让它转圈,并检查我是否,到了屏幕的边缘等等。

    哈佛公开课 - 计算机科学课程节选

  • The loop invariant what does the loop invariant mean? It says, here is a property that is true of this structure every time through the loop.

    循环不变量是什么意思?,它是一个在结构体中,每次循环都为真的属性。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Otherwise the test is always going to be true, we're going to go off here, but this would loop forever if I did that.

    否则测试结果就会一直为真,我们需要离开这个测试,否则就会一直执行循环。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • And that's very nice, because this allows me to be sure that my FOR loop is going to terminate.

    因为这让我确信我的FOR循环是会终止的,因为只要集合是有限的。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • The cookies were going back and forth and back and forth and the hearts up and down, well, this thing that we had that called a loop last week with a forever block with a statement inside of it is simply gonna look a little something like this.

    这些饼干人来来回回的移动,还有这些爱心们上上下下地漂浮,都用到我们上周提到过的循环结构,当然还有个声明在里面,就有点像屏幕上,显示的这样。

    哈佛公开课 - 计算机科学课程节选

  • So with this type of loop, things get a little bit reversed.

    这种类型的循环,东西变得有点颠倒的。

    哈佛公开课 - 计算机科学课程节选

  • The inner loop, this part here, I do m times.

    这个循环执行了多少次呢?

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Now there's this last type of loop.

    现在这里还有最后一个循环类型。

    哈佛公开课 - 计算机科学课程节选

  • Now this happens to be what we would call a linear process, because the number of times I go around the loop is directly related to the size of the argument. If I double 2 the argument, I'm going to double the number of times I go around the loop. If I increase it by five, 5 I'm going to increase by five the number of times I go around the loop.

    这恰好是我们会成为,线性复杂度程序的一个例子,因为我要执行循环的次数是,和输入的参数的大小直接相关的,如果我将这个参数乘以,那么我就要将进行循环的次数也乘以2了,如果我把参数加上,那么循环的次数也要加上5了。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Sorry? OK. You're doing the whole thing for me What's the complexity just of this inner loop m How many times do I go through that loop?

    就这一块代码的,我执行了多少次这个循环?,次对不对?,here?,Just,this,piece。,我一会儿就会去得到你的答案的?

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Well in C and other languages that we'll see this semester, you use what's called the for loop, and this as syntax isn't quite as straightforward but once you know what to look for, it's very easy to understand.

    在C语言和一些我们这学期将要接触的编程语言中,你将会用到所谓的for循环,也许作为一种语法规则,它看起来不是那么的通俗易懂,但是你一旦知道曲中奥妙,就不难理解了。

    哈佛公开课 - 计算机科学课程节选

  • is run a FOR loop here. I'm going to let the number of chickens be in this range.

    我知道怎么做对吧?写一个小循环,我所需要做的就是运行一个for循环。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • The difference with the do while loop, as the syntax kind of suggests, is that this construct is going to do something no matter what.

    作为建议的语法,do,while循环的不同之处,是这个结构不管怎么样,它会做一些事情。

    哈佛公开课 - 计算机科学课程节选

  • I'm going to give a name to that. And what you see there is I'm going to call divisors initially an empty tuple, something has nothing in it. Right here. And then I'm going to run through the same loop as before, going through this set of things, doing the check.

    你们可以看到这里,我初始化一个空的元组,名为divisiors,这里,然后我会去运行,跟以前一样的循环,遍历这个集合内的东西,然后做检查,现在我要做的是,每次我找到了一个除数我要把它收集起来。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • So this do while loop immediately breaks out at the point of that check.

    所以这个do,while,循环在检查的时候,直接中断了。

    哈佛公开课 - 计算机科学课程节选

  • So a loop or an infinite loop, because true is always true, there is no-- nothing on the screen that seems to change this keyword true, so this is actually a deliberate infinite loop, but so was that thing up top to forever say hi or whatever it is you wanted to do.

    因此而出现死循环,屏幕上的这些语句无论怎么运行,都无法改变它为真的事实,这就是所谓的死循环,无论你想不想要,屏幕上都会不断打印出“hi“

    哈佛公开课 - 计算机科学课程节选

  • I'm again, iterating with this four loop, same code as before.

    我再次,重复使用for循环,同样的代码。

    哈佛公开课 - 计算机科学课程节选

  • Ah ha, it goes into that accept portion, prints out a message, and goes back around the while loop to say try again. And it's going to keep doing this until I give it something that does serve as a float.

    他会说输入一个浮点数,啊哈,它就到了那段处理代码,打印出消息,然后回到while循环让我们再输一次,它会持续这么做直到它接受到一个浮点数。

    麻省理工公开课 - 计算机科学及编程导论课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定