I am trying to simulate 2000 dice rolls of an 11 sided die (number 2 through 12 on the sides). I have to store the data in an array.
here's my loop where the die is rolled:
for($counter = 0; $counter <=2000; $counter++)
{
$die = rand(2, 12);
$int[$counter] = $die;
echo " $die ,";
}
^ that seems to work okay as I have 2000 random numbers output.
The next part is where I have trouble. I have to output some of the results. Just to make it simple, let's say I have to output the number of fives that were rolled with an echo statement like:
"__ fives were rolled."
I can't seem to get it to work. For this assignment I HAVE to use a for loop. I tried making a new one with an if statement, and including an if statement in the loop up above. No luck with either. How can I make this work?