Skip to content

Instantly share code, notes, and snippets.

@gellydew
Created June 7, 2017 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gellydew/1176803d077da01898cb0ea6331a0a08 to your computer and use it in GitHub Desktop.
Save gellydew/1176803d077da01898cb0ea6331a0a08 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// namespace
namespace VirtDice
{
// class
class Program
{
// function (entry point)
static void Main(string[] args)
{
// Greets the user.
Console.WriteLine("Welcome to Virtual Dice Roll Version 2.1, by gellydew! Hope this serves you well. Press enter to roll, type q to quit!");
// Makes it minimizable, for neat code.
#region Roll Function
// Loops infinitely.
while (true)
{
// Stores what the user types. Not needed but for some odd reason it keeps it from breaking.
String inact = Console.ReadLine();
bool b = inact == "0";
if (inact == "q")
{
break;
}
// Creatin a randomizer object.
Random roll = new Random();
// Having it randomly produce 6 numbers.
int ro = roll.Next(5);
Console.WriteLine("You rolled a {0}!", ro);
}
#endregion
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment