Пример #1
0
        static void Main(string[] args)
        {
            RPSGame game       = new RPSGame();
            bool    IsGameOver = false;

            while (!IsGameOver)
            {
                Console.Write("Let's Play! Choose: (R)ock, (P)aper, (S)cissors.");

                RPSGame.Option userPlay;
                if (!RPSGame.TryParseMove(Console.ReadLine(), out userPlay))
                {
                    continue;
                }


                RPSGame.Option computerPlay = RPSGame.GetAIMove(game.RecordedUserMoves);
                string         playResult   = game.Play(userPlay, computerPlay); //human or computer or tie
                Console.WriteLine("Result: {0}", playResult);

                Console.WriteLine("Play again (y/n)?");
                string playAgain = Console.ReadLine();
                IsGameOver = playAgain == "n";
            }
        }
        static void Main(string[] args)
        {
            RPSGame game = new RPSGame();
            bool IsGameOver = false;
            while (!IsGameOver)
            {
                Console.Write("Let's Play! Choose: (R)ock, (P)aper, (S)cissors.");

                RPSGame.Option userPlay;
                if (!RPSGame.TryParseMove(Console.ReadLine(), out userPlay))
                {
                    continue;
                }

                RPSGame.Option computerPlay = RPSGame.GetAIMove(game.RecordedUserMoves);
                string playResult = game.Play(userPlay, computerPlay); //human or computer or tie
                Console.WriteLine("Result: {0}", playResult);

                Console.WriteLine("Play again (y/n)?");
                string playAgain = Console.ReadLine();
                IsGameOver = playAgain == "n";
            }
        }