mikechambers / as3corelib

An ActionScript 3 Library that contains a number of classes and utilities for working with ActionScript? 3. These include classes for MD5 and SHA 1 hashing, Image encoders, and JSON serialization as well as general String, Number and Date APIs.
1.49k stars 448 forks source link

Add shuffle method to ArrayUtil class #170

Open endel opened 13 years ago

endel commented 13 years ago

It's a simple feature that are implemented in different ways around the community. It would be nice if as3corelib natively support it.

var array : Array = new Array(1,2,3,4,5); ArrayUtil.shuffle(array); trace(array); // shuffled items

peterver commented 12 years ago

Shuffling something isn't really a prime feature ... it's not necessary for wide usage. As such i think it'd be not a good idea to add as it would increase the swc size ( without needing it most of the time ). If you need a shuffling function then i suggest taking the source and extending it :) ( it's not that hard to write one )