Be a Supporter!

about randoms,...

  • 265 Views
  • 2 Replies
New Topic Respond to this Topic
geohoundz55
geohoundz55
  • Member since: May. 31, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
about randoms,... 2009-03-16 07:28:35 Reply

what should I do so that I made a random no.
for example

function randomHelp() {
Help = int(Math.random()*10);

and once the it chosen a number for example is 8..
on the next random number would not be 8 instead another number,.
so that 8 can be chosen again,.

TheSongSalad
TheSongSalad
  • Member since: Jan. 17, 2009
  • Offline.
Forum Stats
Member
Level 19
Audiophile
Response to about randoms,... 2009-03-16 08:04:37 Reply

try

random(#)

with # being your desired top number, i was trying to use Math.random too until i discovered random()

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to about randoms,... 2009-03-16 08:53:21 Reply

function randomHelp(){
	while(Help==lastNum){
		Help=int(Math.random()*10);
	}
	lastNum=Help;
}

- - Flash - Music - Images - -

BBS Signature