• When I call this class definition, it calls init, init and I give it an x and a y value.

    我说过,当我们,调用这个类的定义的时候,它会去调用。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • All right, c p 1 dot y, x I've said assign that to the value 2, 2,0. So now c p 1 has inside of it an x and y value.

    一个特定的版本,我现在命名了一个内置变量,并给它赋值了,我刚刚做的也就是给它。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Right. So X get assigned the value of Y, but then Y gets the value of X; so what have you really done?

    对的,X被赋值成Y的值了,然后Y获得了X的值,你到底做了什么呢?

    哈佛公开课 - 计算机科学课程节选

  • This point here then is the present value of your income; it's Y today + / .

    直线与x轴的交点表示收入的现值,它等于

    耶鲁公开课 - 金融市场课程节选

  • I'm going to say, gee, p2 is the x value the same in both of them, and if it is, and the y value's the same, then this is the same point, I'm going to return true.

    这样的数据对象,我会把它们命名为p1和,我会去查看,看看两个对象中,的x值是不是相同,如果相同的话,就去查看y值是否相同。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • If it's in polar form I passed in a radius and angle and I'll compute what the x- and y- value is.

    以及半径和角度,但是现在是这样的,不管我是以哪种形式。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • It becomes a 13 and that is consistent with the code and it also doesn't crash because now y has been assigned to the correct value.

    它变成了一个13,这个和代码是一致的,程序也不会崩溃,因为现在y被赋了正确的值。

    哈佛公开课 - 计算机科学课程节选

  • Notice in the class definition here, is there, this is the first thing that's got called, and I just called with the value for x and the value for y, and it went off and did something for me.

    就在这里,这是第一个被调用的东西,我用x的值和y的值调用了它,然后这个方法继续进行,并为了做了一些操作。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • The value 2 is still in what we called Y. It's now also in what we called X, but notice inside of main and here's the power.

    数值2还是在y中,现在,它也在x中,但注意在main中,这是那个能力。

    哈佛公开课 - 计算机科学课程节选

  • It says, take value of y and value of x, add them together, y and create that as the new value of y.

    把x和y的值,加到一起,然后把和赋值给。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • And actually, if I don't want to clobber, as we say, overwrite the value of my variable, ; I could declare another one and store the return value in Y; Y so now I have two ints in memory; X and Y, 3 one with two, one with three.

    实际上,如果你不想彻底清除,像我们说的,覆盖那个变量的值,我可以申明另一个变量Y,并在Y中保存那个返回值;,现在内存中有两个int数,X和,一个的值为2,一个为。

    哈佛公开课 - 计算机科学课程节选

  • And I'll give it an x value of 3 3 and a y value of 4.

    一个笛卡尔坐标3,然后给p2的x坐标赋值为。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • self y Notice what I also do here, I create self dot y, give it a value, and then, oh cool, I can also set up what's the radius and angle for this point, by just doing a little bit of work.

    我创建了,然后给它赋值,然后,噢太酷了,通过做一点额外的工作,就可以得到点的半径和角度了,好,实际上如果。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Right now it's a simple template, but it's a template for creating what a class looks like, and I now have an x- and y- value associated with each instance of this.

    那么大家明白了为什么,我说类是一个模板了,对不对?,现在它只是一个简单的模板,但是它是一个用来-,创建形成一个类的模板。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • It says, if I want to print out something I built in Cartesian form up here, says, again, I'm going to pass it in a pointer to the instance, that self thing, and then I'm going to return a string that I combine together with an open self and close paren, a comma in the middle, and getting the x-value and the y-value and converting them into strings before I put the whole thing together.

    这不仅仅是个列表,它是怎么来做的?,流程是:如果我想要返回,一些已经在笛卡尔模式下建好的值,好,再说一遍,我首先要传入一个,指向实例的指针,也就是,然后我会返回一个,由开括号,闭括号,中间的一个逗号,以及提前转换为字符串格式的。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • So I don't know don't, John, I would argue if I'd written this better, I would have had a method that returned the x- and the y- value, and it would be cleaner to go after it that way.

    我会去辩论这么写是不是更好,我也可以写一个,返回x坐标和y坐标的方法,这么做可能会更清楚一点,这是很棒的缩写,好。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • It's reasonable because it's meant TMP for temporary purposes just to call it temp or T-M-P for short, X and I can define temp as -- why don't I set it as equal to X, initially, because now that I've stored X in a separate chunk of memory, I can now change its value and then I can say Y gets, not X, but temp, and so now I've actually swapped these values.

    这是合理的,因为它是为,暂时的目的,只要叫它Temp或简称它为,我可以定义temp为--为什么我不把它设定为等于,最初的,因为现在我把X存储在一个单独的内存块中,我现在可以改变它的值,然后我说Y等于,不是X,而是temp,所以现在我交换这些值。

    哈佛公开课 - 计算机科学课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定