Untitled
Anonymous
plain_text
09/08/2023 12:37 PM
692 B
25
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...