/*
p1 = Posn( 0, 0 )
...
ps = Posn[] { p1, p2, p3 ... }
*/
so you can distinguish between when ps changes and when pi changes
Jay
2011/6/15 Joe Larson <brothe...@gmail.com>:
--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay
"The glory of God is Intelligence" - D&C 93
Not exactly...
Here's one for #1
// Step 0
p0 = (0,0)
ps = [ p0 ]
// Step 1
p0 = (0,0)
p0' = (10,10)
ps = [ p0' ]
Here's one for #2
// Step 0
p0 = (0,0)
ps = [ p0 ]
// Step 1
p0 = (10,10)
ps = [ p0 ]
Jay
This is wrong because "new Posn (10,20)" is not the name of a posn,
like "zero", "one" and "two" are. Give that new posn a name and the
array should have that in it.
Jay
Thanks.
The problem with writing "new Posn" anywhere is that it isn't clear
that it ISN'T a new posn. It's the same old posn with new values
inside.
>
> I'm supposed to create new Posns for ex1 right? then change it to
> mutate for ex2 right?
Correct
That is an accurate statement
> Could I ask for a template or something of the like?
I have sent three templates.
Jay
Pretend that there is a variable for it. That's what p0' was.
Jay