My archive doesn't go back to the original thread, but I found a
reference to it:

Array.prototype.shuffle = function() {
   var i = this.length;
   while (i) {
       var p = random(i);
       var t = this[--i];
       this[i] = this[p];
       this[p] = t;
   }
}

That's the solution Fumio Nonaka and Tatsuo Kato came up with back in
the day. It was a classic, extensive discussion on the topic here,
from a very long time ago. I still remember following it, as a young
coder, watching how some of the greatest FlashCoders of the time
discussed what the fastest way of shuffling an array might be.

Ah, well. Those were the days...

Mark
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to