It could run and give you the right answer, it could crash, it could loop forever, it could run and apparently give you the right answer.
它可能会正确运行,并返回给你一个正确的答案,它可能会崩溃,它可能会一直运行下去,它可能会运行并给你正确的答案。
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.
否则测试结果就会一直为真,我们需要离开这个测试,否则就会一直执行循环。
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 when scratch blocked terms, I'd have a four loop or like a forever loop or something and then another one inside.
当scratch阻塞了,我用一个for循环,或者一个永久循环之类的东西,然后另一个在里面。
Then we have to steal the code from earlier to do a forever loop, a while true loop and then I'm gonna go ahead and use that printf thing that we saw.
然后再借用先前的代码,做一个永久性的循环,即while循环,紧接着需要用到一个,之前我们看到过的printf函数。
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“
应用推荐