Esempio n. 1
0
        public void Start()
        {
            for (int i = 0; i < _rounds; i++)
            {
                Player roundWinner = null;
                do
                {
                    roundWinner = PlayRound();

                    if (roundWinner != null)
                    {
                        Console.WriteLine($"{roundWinner.Name} wins");
                        roundWinner.AddWin();
                    }
                }while (roundWinner == null);
            }

            if (_player1.Wins > _player2.Wins)
            {
                Console.WriteLine($"{_player1.Name} has won more games");
            }
            else if (_player2.Wins > _player1.Wins)
            {
                Console.WriteLine($"{_player2.Name} has won more games");
            }
            else
            {
                Console.WriteLine("They have won the same number of games");
            }
        }