I know this is the case, what I was trying to prevent doing was giving the 'player' the opporuntity to use the copy of the list if the list was passed by value; they could modify this with no concern over altering the original array. (So, for example, doing something that stores the sum in some place in the list copy, would be possible). However, with passing by reference, any changes to the sub's array would affect the original array, and thus you are forced to find another means to store the value.
In reply to Re: Re (tilly) 1: "Junkyard" Puzzle: Average of Numbers
by Masem
in thread "Junkyard" Puzzle: Average of Numbers
by Masem
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |