in reply to Need help with number generator
$randnum = int(rand(100));
if ( $randnum > 20 ) #80%
#stuff for 1
if ( $randnum > 90 ) #10%
#stuff for 2 and 3
It would do #stuff for 1
_and_ #stuff for 2 and 3 10% of the time.
And 20% of the time it would do nothing...
Remember to think before you code! :-P
1. Keep it simple
2. Just remember to pull out 3 in the morning
3. A good puzzle will wake me up
Many. I like to torture myself
0. Socks just get in the way
Results (8 votes). Check out past polls.