Return to Snippet

Revision: 20108
at November 7, 2009 19:31 by adrianparr


Initial Code
private function shuffleArray($array:Array):Array
{
	var shuffledArray:Array = new Array();

	while ($array.length > 0) {
		shuffledArray.push($array.splice(Math.round(Math.random() * ($array.length - 1)), 1)[0]);
	}
			
	return shuffledArray;
}

Initial URL
http://flassari.is/2009/04/as3-array-shuffle/

Initial Description

                                

Initial Title
Shuffle an Array

Initial Tags
array

Initial Language
ActionScript 3