public void Play() { var isWinning = false; while (!isWinning) { GuessCount += 1; _inputValidator.ThrowExceptionWhenTriedTooManyTimes(GuessCount); DisplayAllowedColours(); var selectedColours = UserSelectColours(); _currentSolution = Player.GenerateSolution(selectedColours); Output.Write(_currentSolution); var shuffledHint = Mastermind.CreateShuffledHintBasedOnPlayerSolution(_currentSolution); Output.Write(shuffledHint); isWinning = Rule.IsWinningCondition(shuffledHint); } Player.IsWinner = true; Output.Write(GameInstruction.YouWonMessage()); }