Array.shuffle()?

I've been wondering lately, is there any particular reason Array
doesn't have a shuffle() method? I realize it's pretty simple to roll
my own, but this seems useful in many situations so I'm surprised it's
not part of the core. Any thoughts?

Advertisements

"James Edward Gray II" <> schrieb im Newsbeitrag
news:...
> I've been wondering lately, is there any particular reason Array
> doesn't have a shuffle() method? I realize it's pretty simple to roll
> my own, but this seems useful in many situations so I'm surprised it's
> not part of the core. Any thoughts?

I'd assume the reason is that there might be arbitrary many shuffle
implementations with no obvious default implementation. I guess there are
many algos that need shuffling with certain properties.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!