So I'm going to ask you to look now at this set of things, which is solve 1 and Barnyard 1.
所以我想问问,现在你怎样看待一些列事情。
Barnyard1 OK. The change is, well, on Barnyard 1 it looks much the same as it did for Barnyard.
也就是solve1和,做出的变化就是在Barnyard1中。
Right, I'm going to read in the values of the number of heads and the number of legs.
它看上去和Barnyard完全一样,现在我要读入头数和腿数。
But I don't have to know, inside of Barnyard, what the values are used inside of solve.
但是我不用知道,在Barnyard内部。
It could be the pair of none, none, it could be the pair of, you know, whatever the answer was that we put up there. That value comes back out and is now available inside the scope of Barnyard. OK. And Barnyard then uses that. Question?
也可以是,你知道,任何我们在这里得到的答案,这个返回的值在Barnyard范围内,就可以使用了,然后Barnyard就使用了这个值,有什么问题吗?
First of all, two parameters. It's OK. All it says is, when I call this, I need to pass in two parameters for this to work. All right? Now, if I want to use that, I'm going to use a second piece of code here, called Barnyard. I'm going Barnyard to read in a couple of values, convert them into integers, and then I'm going to use solve to get a solution out.
注意我得到了什么,第一,两个参数,它的意思就是我调用这个函数,我得给它输入两个参数,明白了吗?,现在如果我要使用它我得用,这里的第二段代码,也叫,我将读入一组值,将它们转化为整型,然后我会用solve得到一个解决方案。
应用推荐