void setup()
{
Serial.begin(9600);
}
long randNum;
int count = 1;
int sixCount = 0;
void loop()
{
while (sixCount < 100)
{
randNum = random(1, 7);
if (randNum == 6)
{
sixCount ++;
}
count++;
}
Serial.print("It took ");
Serial.print(count);
Serial.print(" throws of the dice to reach 100 6's \n");
delay(2000);
count = 0;
sixCount = 0;
}
No comments:
Post a Comment