static void Main(string[] args) { Console.WriteLine("Welcome to the game of Rock Paper Scissors"); Console.WriteLine("Please Enter Your Name: "); string input = Console.ReadLine(); HumanPlayer user = new HumanPlayer(input); Player opponent = SelectOpponent(); bool repeat = true; while (repeat) { Roshambo userPick = user.GenerateRoshambo(); Roshambo oppPick = opponent.GenerateRoshambo(); string result = GetWinner(userPick, oppPick); Console.WriteLine($"{user._Name}: {userPick}\n{opponent._Name}: {oppPick}\n{result}"); Console.WriteLine("Would you like to keep playing? (Y/N):"); repeat = Validator.DoAgain(); } }
static void Main(string[] args) { Console.WriteLine("Welcome to Rock Paper Scissors!!!\n"); Player user = new HumanPlayer(); user.Name = Validation.GetName(); Player opponent = Validation.GetOpponent(); bool continueFlag = true; while (continueFlag) { user.RPS = user.GenerateRoshambo(); opponent.RPS = opponent.GenerateRoshambo(); Validation.RPSOutcome(user, opponent, user.Name, opponent.Name); Console.Write("Play again? (y/n): "); Validation.YesOrNo(Console.ReadLine(), ref continueFlag); } Console.WriteLine($"\nOK BYEEEEEEEEEEEEE!!!!!!\n"); }