# Random number push array

**URL:** <https://forum.kirupa.com/t/random-number-push-array/306860>\
**Category:** Uncategorized\
**Created:** [March 23, 2010, 3:35pm UTC](https://forum.kirupa.com/t/random-number-push-array/306860 "2010-03-23T15:35:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jinackman](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@jinackman](https://forum.kirupa.com/u/jinackman)\
**Post date:** [March 23, 2010, 3:35pm UTC](https://forum.kirupa.com/t/random-number-push-array/306860/1 "2010-03-23T15:35:32Z")

</div>

Hi  
i have been racking my head for days over random number no repeats

iam doing a bingo caller game iam stuck with random number with no repeats  
this is the code snipplet im using

```auto
var num:Number = Math.ceil(Math.random()*90);

```

i use the timer class to call a number every few seconds

how do i do it with no repeats,

do i have to put the numbers into a array then pull the numbers from the array,  
here is some code i have found but can’t get it to work

```auto
var firstarray:Array = new Array();
for(var u:Number = 1; u <= 90; u++){
firstarray.push(u);
}
var secondarray:Array = new Array(); 
while (firstarray.length >0) {
var num:Number = Math.floor(Math.random()*firstarray.length);
secondarray.push(firstarray[num]);
firstarray.splice(num,1);
} 
while (myNumbArray.length>0) {
  myRandArray.push( myNumbArray.splice(randRange(0, myNumbArray.length-1), 1));
}
trace (num);
}

```

please help i just can’t get my head baround it
