private static Random random = new Random();
public static void Main(String[] args)
ComputerChips = random.Next(3) + 1;
Player = random.Next(2) + 1;
Console.WriteLine("Chips left on the table: " + Score);
Console.WriteLine("How many chips do you want to take?");
while (! (UserChips >= 1 && UserChips <= 3))
Console.WriteLine("You can only take between 1 and 3 chips. Try Again.");
Score = Score - UserChips;
Score = Score - ComputerChips;
Console.WriteLine("My turn. I'm taking " + ComputerChips + " chip(s).");
Console.WriteLine("I win because of my far superior intellect. ");
Console.WriteLine("You win. ");
private static void input(out double result)
while (!double.TryParse(Console.ReadLine(), out result));
private static void input(out int result)
while (!int.TryParse(Console.ReadLine(), out result));
private static void input(out Boolean result)
while (!Boolean.TryParse(Console.ReadLine(), out result));
private static void input(out string result)
result = Console.ReadLine();