Untitled
unknown
plain_text
2 years ago
518 B
15
Indexable
Roll roll6 = new Roll();
roll6.rollSixDice();
public class Roll
{
Random random = new Random();
public static int[] sixDice = new int[7];
public void rollSixDice()
{
for (int i = 1; i < 21; i++)
{
int j = random.Next(1, 7); //roll
sixDice[j]++; //store
}
for (int k = 1; k < sixDice.Length; k++)
{
Console.WriteLine(k + ": " + sixDice[k]); //display
}
}
}
class Store
{
}
class Display
{
}Editor is loading...