I can be a little more careful about keeping track of what goes on inside of that loop. If I don't have any more work to do, let me just stop.
我能更小心点来跟,踪循环里发生了什么,如果没什么可干的了,就停下来吧。
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.
如果有时间,我想看看,我们需要花多长时间解决这一问题,事实上,它是我故意,使用的无穷循环。
Well, you'll know when it crashes, that doesn't help you very much, but you can't always tell whether something's stuck in an infinite loop or whether it's simply taking a long time to compute.
好,你将学到它在什么时候会崩溃,这对你帮助并不大,但是你不能辨别出到底是在一个循环中,有什么东西卡住了呢,还是程序需要很长的时间来计算一个结果呢。
By two, by two, by two, and here it just conceptually is why this thing doesn't infinitely loop.
除以2,除以2,除以2,这里只是概念性地说明这一,过程为何不会无限循环。
And we won't wait here one hundred seconds for it to finish, but we're using the loop, we're updating a variable, and we're formatting it in a nice way.
我们将不会再这里等待100秒来等它完成,但是我们使用循环,我们更新一个变量,我们把它排成一个漂亮的格式。
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循环,也许作为一种语法规则,它看起来不是那么的通俗易懂,但是你一旦知道曲中奥妙,就不难理解了。
Because the for loop hands me placeholders in between those semicolons for variables and such, now I don't have those with while loops.
因为for循环给我提供了为变量准备的占位符,它们在分号之间,现在在while循环中,我没有这些。
You don't get the nice little feature of a for loop.
你没有理解for循环的美好的小特征。
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值。
应用推荐