OK, so what have I done? I just added a little bit more now. I'm now running through a pair of loops. Again notice the encapsulation, that nice abstraction going on, which is what I want. Once I get to this stage though by the way, there might be more than one solution.
我现在运行了一对循环,再一次注意这个封装,抽象得很好,这就是我想要的结果,我按这种方式走到这一步的时候,可能会有多组答案。
Imagine I have a little lamp, a little goose- one of those little gooseneck lamps, I'd put it on the table here, I'd put the height about a f-- about a foot off the table. And if I was really good, - I could hit, or time it so that when I hurt- yeah, try again. When I turn this on switch on in the lamp, at exactly the same time, I'm going to hit a key on my computer and start it running.
想象下我有一个那种小雁颈台灯-,我把它放在桌子上,大概离桌子,有一英尺那么高吧,这样挺好的,我可以打开-,或者关闭这灯,并在这同时,我可以让我电脑,开始运行。
So what's going to happen here? If I'm inside this FOR, OK, and I'm running around, if I ever hit a place where this test is true, I'm going to execute that return, return that return returns from the entire procedure. OK? So the return comes back from the procedure.
那么这里发生了什么呢?,如果我是在这个for循环里面,我正在运行,如果我运行到test的值为真的地方,我就会执行,这个return将会返回整个程序的值,明白了吗?所以它将会从整个程序中返回值。
应用推荐