|
using System;
class ThrowRoll
{
public static void Main ()
{
int roll = 0;
Random rnd = new Random (); // Please help me explain what Random means or usage? What I know is this sentence creates a variable that stores random numbers
roll = (int) rnd.Next (1,7);
Console.WriteLine ("Start the dice");
Console.WriteLine ("This time the roll is: {0}", roll);
switch (roll)
{
case 1:
case 3:
case 5:
Console.WriteLine ("The dice is odd"); break;
case 2:
case 4:
case 6:
Console.WriteLine ("The dice is even"); break;
default:
Console.WriteLine ("Dice is not 1 ~ 6"); break;
}
}
} |
|