
-----------------------------------
Squirter
Mon Jan 26, 2004 6:39 pm

Dice rolling...
-----------------------------------
I'm trying to generate a number for a 20-sided die being rolled a certain amount of times.


 


Problem is, I want it to make a random number for each roll.  Right now, it only gets one number, and multiplies it by the number of rolls I requested.

e.g  Set to roll 3 times.  First it rolls a 4.  But then it multiplies itself by 3.  4 * 3 = 12.

I want it to make a different number each time, so:

Set to roll 3 times.  5 + 17 +12 = 34.

Anyone know the problem?
(BTW, I'm pretty new to PHP, so if you put in a new command, could you explain it? ^^;)

-----------------------------------
octopi
Mon Jan 26, 2004 8:27 pm


-----------------------------------
I think you want to roll the dice, the number of times specifiyed by 'rolls'

consider the following:



the 'for' command loops the number threw the stuff in the {}'s the number of times specified by the '$x=1;$x 
