And actually, a question that might come up, I just explained, the sodium channel, you might say, well, how do potassium channels work then, because I can understand how you can filter something big out, but how do you filter out something small.
实际上,可能大家会问一个问题,我刚解释过,钠离子通道,你可以说,好吧,那么钾离子通道该如何起作用呢,因为我可以理解你是如何把大东西过滤掉的,但是你如何把小东西过滤掉呢?
All right. The rules, though, are, they can only move one disk at a time, and they can never cover up a smaller disk with a larger disk. OK. Otherwise you'd just move the whole darn stack, OK?
好,规则是,他们只能一次挪动一个盘子,并且不能把大盘子放在小盘子上,不这样的话你就直接,把这一堆盘子都挪过来了对不对?
Now for the hacker edition, if you are feeling up to a bit more of a challenge you'll find that when you run the game, one it's not all that hard to use some ASCII art just make it a little fancier as the teaching fellow who implemented this solution did.
对于升级版,如果你能应付更大的,挑战,你会发现当你在玩这个游戏时,用一些字符画把它做得,比那些教学人员做的更有新意,并不是那么困难。
But when you have many page views and that many people spending much time on the site, you can monetize it pretty easily just by putting matters on there.
当拥有那么大的访问量,当人们花大把时间在你的网站上时,仅靠投放广告,就能轻松赚钱。
If you took out somebody's cortex and flattened it out, it would be two feet square, sort of like a nice--like a rug.
如果你取出某人的大脑皮层,把它摊开,会有两平方英尺那么大,有点像一张地毯
If you want to, you could think of this class as one big hypothetical.
如果你想,你可以把它想象成一个大的假设。
Now, I don't know how far back it goes but it must be that in ancient times some people would say, all right you're going to be doing more work or you're contributing more to this enterprise, we'll give you a bigger share of the profits.
我不知道这能追溯到什么时候,但在古时候肯定有人说,好吧,你比别人干得多,你对公司的贡献更大,我们会把收入的大头给你
So nowadays they just pump you full of some drug to get you really happy and so you're really stoned out of your head, you're and say this isn't so bad.
所以现在他们让你服用大把的药物,让你飘飘欲仙,而你也因为吸食了毒品而变得神志不清,所以你会说,这方法还挺管用的。
But to translate this now to a language C, you've got some curly braces, you got an if, some parentheses, but now we're just building on some of the syntax we introduced before.
如果把它转换成C语言,你又会看到一些大括号啊,if啊,圆括号啊等等,我们只是借助,之前学过的语法规则。
OK, so how can I code this up? Well, you might think, let's just jump in and write some code, I don't want to quite do that though, because I want to show you another tool that's valuable for thinking about how to structure the code, and that is a something called a flow chart. Now.
好,那么我怎么把这个以代码实现呢,你可能会想,让我们进去直接写代码把,但是我不想这么做,因为我想教给大家另外一项很有价值的,用来组织代码的工具,叫做流程图,现在,像Guttag教授,和我这么大岁数的人。
If n is greater than zero, I decided I would say, "You picked a positive number, backslash n," so put the cursor on the next line, else if n was not less than zero, I say, "You picked a negative number, backslash n."
如果n比0大,我就决定来说:,“你选择了一个整数,反斜杠n“,所以你把光标,放在下一行,另外如果n不小于0,我说:,“你选择一个负数,反斜杠n“
应用推荐