in reply to
Re: Re: random number
in thread random number
#splice is still O(n)
$array[$index] = $array[-1];
True. And that's a neat solution.
It would still be better to shuffle the array and simply pop the next one when you need it as was suggested at near the top of the thread.
Examine what is said, not who speaks.
I make decisions, and my brain carries them out
My brain makes the decisions, and I observe them (if I'm lucky)
I make some decisions, and my brain makes others
My spouse makes decisions and I and my brain carry them out
I wrote a program to relieve me and my brain from the burden of decision-making
The black-helicopter people project the decisions into my brain and then I do as ordered
Results (516 votes),