public static void PlayGame(ref int wins, ref int losses, Human UserName, ref Player Opponent) { while (true) { Roshambo Input = UserName.generateRoshambo(new Roshambo()); Roshambo AI = Opponent.generateRoshambo(Input); if (Opponent.Name == "Dr. K") { Counter(ref wins, ref losses, UserName, Opponent, Input, AI); } if (Opponent.Name == "Grant Chirpus") { Counter(ref wins, ref losses, UserName, Opponent, Input, AI); } if (Opponent.Name == "Hulk Hogan") { Counter(ref wins, ref losses, UserName, Opponent, Input, AI); } if (Validate.Continue() == true) { if (Validate.NewOpponent() == true) { Opponent = RoshamboApp.ChooseOpponent(); } Console.Clear(); } else { break; } } }
static void Main(string[] args) { int wins = 0; int losses = 0; Console.WriteLine("Hey there! What's your name?"); Human UserName = new Human(Console.ReadLine()); Player Opponent = RoshamboApp.ChooseOpponent(); PlayGame(ref wins, ref losses, UserName, ref Opponent); Console.WriteLine($"You won {wins} and lost {losses}"); }