Ejemplo n.º 1
0
        private void Play(char[] players)
        {
            bool gameOver = false;

            while (!gameOver)
            {
                foreach (var player in players)
                {
                    TakeTurn(player);
                    if (_winCondition.IsWinner(player))
                    {
                        PrintWinner(player);
                        gameOver = true;
                        break;
                    }

                    if (_winCondition.IsDraw())
                    {
                        PrintDraw();
                        gameOver = true;
                        break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void Play(char[] players)
        {
            while (true)
            {
                foreach (var player in players)
                {
                    TakeTurn(player);
                    if (_winCondition.IsWinner(player))
                    {
                        PrintWinner(player);
                        break;
                    }

                    if (_winCondition.IsDraw())
                    {
                        PrintDraw();
                        break;
                    }
                }
            }
        }