Raised This Month: $ Target: $400
 0% 

Help with random choose...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-31-2013 , 09:23   Re: Help with random choose...
Reply With Quote #3

Equal chance:
Code:
switch( random(4) ) {     case 0: // Do something     case 1: // Do something     case 2: // Do something     case 3: // Do something }
Percentages:
Code:
switch( random_num(1, 100) ) {     case 1 .. 5: // Do something, 5%     case 6 .. 49: // Do something, 44%     case 50: // Do something, 1%     case 51 .. 100: // Do something, 50% }
__________________

Last edited by Black Rose; 08-31-2013 at 11:42. Reason: Sorry about that.
Black Rose 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 19:01.


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