- Win detection now uses per-player row/col/diagonal counters instead of scanning lines; O(1) per move and works for any board size (change N) - Moved spielfeld into gameState as board[N][N]; removed global - Replaced recursive getUserInput with a loop to avoid stack overflow on repeated bad input; also handles non-integer cin failures - Initialized gameState::winner to ' ' to avoid undefined behaviour - Fixed draw output: prints "Unentschieden!" instead of "Der Gewinner ist: -" - Removed stale TODO comment that incorrectly claimed draw detection was broken Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3.3 KiB
3.3 KiB