Raised This Month: $ Target: $400
 0% 

Random numbers without repeating


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-02-2016 , 12:27   Re: Random numbers without repeating
Reply With Quote #4

PHP Code:
for(new i=0i<5i++)
{
   
num[i] = random_num(110);
   while(
num_exists(num[i], num) )
   
num[i] = random_num(110);

}  

bool:num_exists(numbercountsource[]){

 for(new 
jcountj++)
 if(
source[j]==number)
 return 
true;
 
 return 
false;


Last edited by siriusmd99; 05-02-2016 at 12:29.
siriusmd99 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode