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

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

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

  • So here I've hardcoded the word true which is actually deliberately inducing what we called what last week.

    所以在这里我们可以把条件写死,也就是我们上周提到过的,故意让循环条件,一直为真。

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

  • If it isn't, then I'm going to go back around the loop, and notice what happens. If I get all the way around the loop, that is, all the way through that FOR loop and I never find a path that takes me through here, then the last thing I'm going to do is return a pair or a tuple with a special simple number none twice.

    如果没有,我会回到循环看看发生了什么,如果我运行了整个循环,也就是整个for循环,我仍没有找到符合条件的路径,那么我最后做的事情就是返回一对,或者一个数组的两次none值。

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

  • It's not a good thing if you're just looping and checking some condition, but never actually changing the state of the world.

    这不是一个好事情,如果你只是循环,检查一些条件,但是永远不要改变世界上的国家。

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

  • You've got a loop, you've got a condition and a boolean to check if he's touching the edge, and some statements to tell him to shout or to actually turn around.

    我们有一个循环,通过一个条件和一个布尔值来判断,是否触到了边缘,还有一些语句,让它回头并咆哮。

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

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

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

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

  • There are so many other constructs like loops and conditions and such, so what I thought we do in conclusion today is look at this program.

    这里有很多其他结构类型如循环控制,条件分支等等,所以我觉得应该,以这个程序作为结束。

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

  • So conceptually the key difference here, besides the syntax looking slightly different, it just means that if you want a chunk of code to execute no matter what initially, ; you can use the do while loop; if you want to check a condition first, you can use the while loop.

    所以概念上,则关键的区别是,除了语法看起来有点不同,它的意思是如果你想要一段代码,最初无论如何都要执行,你就可以用do,while循环;,如果你想要先检查条件,你可以用while循环

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

  • So in other words, if you terminate these lines early, if you terminate the four loop early, if you terminate an if condition early with that semicolon, the code may very well work; and this is a common source -- of frustration and conundrum because you don't -- because your code looks right and yet it's misbehaving, but that semicolon means stop looking for subsequent lines of related code.

    换句话说,如果你用分号过早的终止了这些代码行,如果你过早地终止了那个for循环,如果如此,一个if条件,代码可能可以运行,这就是,挫折和问题产生的源头,因为你没有-,因为你的代码看起来是正确的,但是运行是错误的,那个分号的意思是,停止寻找后面相关的代码。

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

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

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

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