View Single Post
Old 08-30-2005, 10:35 AM   #2 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
why not write something like this
Code:
<?php
if( rand(0,1) ) {
     $roll = rand(2,6);
     print "You rolled a $roll";
  }
  else {
     print "You rolled a 1";
  }
?>
That way you're mathematically garunteed to roll 1 fifty percent of the time, thanks to the first if statement. But taking 1-3 out of a six sided roll is also 50%.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote