You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const auto change_entry = GetNextChangeEntryFromUser(game);
171
174
game.ChangePlayerNumberIfPossible(change_entry);
172
175
}
176
+
game.Print();
173
177
if (game.CheckIfPlayerWon()) {
174
178
std::cout << "You win!\n";
175
179
} else {
@@ -260,6 +264,17 @@ Therefore a typical advice is to catch any wrong values that propagate through o
260
264
261
265
My favorite tool for this is the [`CHECK`](https://abseil.io/docs/cpp/guides/logging#CHECK) macro that can be found in the [Abseil library](https://abseil.io/docs/). We can use it in our `ChangePlayerNumberIfPossible` to check if the index is within bounds:
0 commit comments