public void PlayGame() { var turn = 0; var retry = 1; while (board.CanPlay()) { var currentPlayer = players[turn % 2]; userInput = Console.ReadLine(); while (!IsValidInput(userInput)) { userInput = Console.ReadLine(); retry++; if (retry == 3) { Console.WriteLine("Error: 3 consecutive invalid moves, next players turn."); break; } } var position = Int32.Parse(userInput); var valid = board.PlaceCounter(position, currentPlayer.GetCounter()); retry = 1; while (!valid) { userInput = Console.ReadLine(); valid = board.PlaceCounter(position, currentPlayer.GetCounter()); retry++; if (retry == 3) { Console.WriteLine("Error: 3 consecutive invalid moves, next players turn."); break; } } if (board.CheckWin(currentPlayer.GetCounter())) { break; } board.PrintBoard(); turn++; retry = 1; } PlayAgain(); }