So, in fact we may not find a sock at all and yet we don't seem to handle that at all unless if we don't find any socks, what do we do?
实际上我们可能找不到袜子,并且不用处理那些事情,前提是我们没有找到任何袜子,我们做什么呢?
We saw this with the sock algorithm a moment ago.
我们前面看到了袜子算法。
If you find a matching sock which you didn't so then else.
如果你找到相匹配的袜子就执行接下来的代码,否则就执行其他。
And so when you start to poke around the puzzle pieces, you see that it can say things, we'll see movement in just a moment and sound and so forth, but at the end of the day, this is just like the program we used a moment ago for the sock exercise where we just hold Philip a step after step after step, do this, do this, do that, and yet, here too, we already see an opportunity for that thing we called the loop.
如果你认真看下这些拼图,你会发现它都是一些移动,并发出声音的功能块,就像我刚才的,练习程序一样,我们让飞利浦做这个动作,做那个动作,跟这里的情况一样,我们已经看到了称为循环的东西。
So the fact that line 9 did not match, if you find a matching sock which we didn't, that means we immediately jump to the else which is line 13 and so Philip now has to do what?
事实上,第九行我们没法匹配,如果你没找到匹配的袜子,这意味着我们立即跳转到第13行,所以现在Philip做什么?
应用推荐