public override string GenerateRoshambo() { rand = new Random(); int random = rand.Next(0, 3); RoshamboValue value = new RoshamboValue(random); return(value.GenerateValue()); //switch (random) //{ // case 0: // return Roshambo.Rock.ToString(); // break; // case 1: // return Roshambo.Paper; // break; // case 2: // return Roshambo.Scissors; // break; // default: // return Roshambo.Rock; // break; //} }
public override string GenerateRoshambo() { try { Console.WriteLine(Name + ": throw rock, paper, or scissors?"); string input = Console.ReadLine().Trim().ToLower(); if (input == "rock") { RoshamboValue value = new RoshamboValue(0); return(input.ToString()); } else if (input == "paper") { RoshamboValue value = new RoshamboValue(1); return(input.ToString()); } else if (input == "scissors") { RoshamboValue value = new RoshamboValue(2); return(input.ToString()); } else { throw new Exception(); } } catch (Exception e) { return("Invalid entry"); } }
public override string GenerateRoshambo() { RoshamboValue value = new RoshamboValue(0); return(value.GenerateValue()); }