Created
June 7, 2017 01:06
-
-
Save gellydew/1176803d077da01898cb0ea6331a0a08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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