All that's going to change, is the value the variable or the value of some data structures.
或者一些数据结构的值,提醒大家在这块代码里面。
What if I don't change the value of that variable inside of the code?
那么如果在循环内部,我不改变这些变量的值会怎么样?
Let me write a function, in fact the literal thing I would do is to say, identify the things that change, give each of them a variable name because I want to refer to them, and then write a function that captures the rest of that computation just with those variable names inside.
让我来写个方法,实际上我的意思是,辨别出变化的东西,然后给它们逐个命名以区分,然后写一个用来计算,这些变量的,包括计算过程的方法。
应用推荐