Computer Science Canada Swap values without temp |
Author: | beard0 [ Tue Sep 20, 2005 10:55 pm ] | ||
Post subject: | Swap values without temp | ||
I just thought it would be neat to try. Here are my results:
I started to do something similar for arrays, but realized that unless they had the same dimensions, they'd have to be flexible, and then by changing their size I'd be doing essentially the same thing as creating a temp. |
Author: | jamonathin [ Wed Sep 21, 2005 8:02 am ] | ||
Post subject: | Re: Swap values without temp | ||
beard0 wrote: I started to do something similar for arrays, but realized that unless they had the same dimensions, they'd have to be flexible, and then by changing their size I'd be doing essentially the same thing as creating a temp.
Yes, but like many Turing commands, we can also play around with what we have. For example, trading one array's values for another would be like . . .
And if one of the array's was longer than the other, and someone did this, they would know that ahead of time, but if they insisted for some reason, than it wouldn't even run. And that's their fault. . . . What ever happened to that "summer long project" . . . |
Author: | [Gandalf] [ Wed Sep 21, 2005 4:06 pm ] | ||
Post subject: | |||
What?
Quote: What ever happened to that "summer long project"
Heh, I guess it was just 'spirited away'.. |
Author: | beard0 [ Wed Sep 21, 2005 4:09 pm ] |
Post subject: | |
Ummm... did you read the title? |
Author: | [Gandalf] [ Wed Sep 21, 2005 4:30 pm ] |
Post subject: | |
Right... Right... ![]() |