Hi
I use function that creates unique array

function uniqueRandomInt(min:Number, max:Number, n:Number) {
                        var a:Array = [];
                        var i:Number = min;
                        while (a.push(i++)<max) {
                                ;
                        }
                        a.sort(function (a:Number, b:Number) { return 
Math.random()*2-1;});
                        return a.slice(0, n);
                }

It works fine for AS2. But for AS3 it gives always the same result
if I ask
uniqueRandomInt(1, 6, 6); I always get 4,2,3,1,5,6

What is wrong in this code for AS3?

Thank you in andvance.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to