Quick question. Whats the fastest way to get 5 random numbers out of a
list
of X number of numbers without having any duplicates?
I like this:
function rndNumArray(max:Number, noZero:Boolean):Array{
var a:Array = new Array();
var n:Array = new
Quick question. Whats the fastest way to get 5 random numbers out of a list
of X number of numbers without having any duplicates?
Kinda like the script below excpet it graps duplicates...
var loopNum:Number = 16;
function getRandomNums(){
for(i=0; i5; i++){
lastNum = newNum;
http://www.actionscript.org/forums/showthread.php3?s=threadid=28769
Quick question. Whats the fastest way to get 5 random numbers out of a
list
of X number of numbers without having any duplicates?
Kinda like the script below excpet it graps duplicates...
var loopNum:Number = 16;
function
This works for me:
for(i=0; i5; i++){
seq[i]=99;
do{
mflg=0;
x=Math.floor(Math.random()*16);
for(j=0; j=i; j++){
if(x==seq[j]) mflg=1;
}
} while(mflg==1);
thanks guys. I appreciate it.
On 11/30/06, Odie Bracy [EMAIL PROTECTED] wrote:
This works for me:
for(i=0; i5; i++){
seq[i]=99;
do{
mflg=0;
x=Math.floor(Math.random()*16);
for(j=0; j=i; j++){
5 matches
Mail list logo