Polyhedral dice
Sign in to test your solution.
// Polyhedral dice program
using System;
class Submission
{
// -------------------------
// Globals
// -------------------------
static Random random_generator = new Random();
// -------------------------
// Subprograms
//--------------------------
static int roll_dice()
{
int result = random_generator.Next(1, 7);
return result;
}
// -------------------------
// Main program
// -------------------------
public static void Main(string[] args)
{
int number = roll_dice();
Console.WriteLine($"You rolled a {number}");
}
}
You can submit as many times as you like. Only your latest submission will be taken into account.
Sign in to test your solution.