コード例 #1
0
        public void ChoosePlayers()
        {
            Console.WriteLine("Would you like to play (one) or (two) players?\n" +
                              "Type (quit) to exit");
            string PickPlayer = Console.ReadLine();

            {
                if (PickPlayer == "one")
                {
                    Console.WriteLine("Ok, you will play against the computer.");
                    Game start = new Game();
                    start.PlayGameOnePlayer();
                }
                else if (PickPlayer == "two")
                {
                    Console.WriteLine("Ok, you will play against a friend.");
                    Game play = new Game();
                    play.PlayGameTwoPlayers();
                }
                else if (PickPlayer == "quit")
                {
                    Environment.Exit(0);
                }
                else
                {
                    Console.WriteLine("Please enter (one) or (two).");
                    ChoosePlayers();
                }
            }
        }