Beispiel #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to the Rock Paper Scissors game! ");

            //  Player p = new PlayerThree();
            RoshamboApp roshambo = new RoshamboApp();

            roshambo.PlayMatchUp();


            //Console.Write("Enter your name: ");
            //string userName = Console.ReadLine();
        }
        static void Main(string[] args)
        {
            string tryAgain = "Would you like to try again? (y/n)";

            RoshamboApp app = new RoshamboApp();

            bool resume = false;

            do
            {
                try
                {
                    ShowMainMenu();
                    int input = int.Parse(GetUserInput(""));
                    if (input == 1)
                    {
                        app.SetUserName();

                        int opponentChoice = AskWhichOpponentToFight();

                        if (opponentChoice == 1)
                        {
                            app.DumbGame();
                            resume = AskToTryAgain(GetUserInput(tryAgain));
                        }
                        else if (opponentChoice == 2)
                        {
                            app.Game();
                            resume = AskToTryAgain(GetUserInput(tryAgain));
                        }
                        else if (AskWhichOpponentToFight() != 1 && AskWhichOpponentToFight() != 2)
                        {
                            resume = AskToTryAgain(GetUserInput(tryAgain));
                        }
                    }
                    else if (input == 2)
                    {
                        resume = false;
                    }
                    else if (input != 2 || input != 1)
                    {
                        resume = AskToTryAgain(GetUserInput(tryAgain));
                    }
                }
                catch (Exception)
                {
                    resume = AskToTryAgain(GetUserInput(tryAgain));
                }
            } while (resume == true);
        }