Jannis Heydemann ef4f2d2cbf Refactor win-check to O(1) counter-based approach, scalable to any NxN
- 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>
2026-04-24 13:11:08 +02:00
2026-04-22 15:40:45 +02:00
2026-04-23 10:26:31 +00:00

Installation

$ git clone https://gitea.starfour.de/Berufsschule/tictactoe.git
$ cd tictactoe
$ cl main.cpp
$ main.exe
Description
No description provided
Readme 42 KiB
Languages
C++ 96.6%
CMake 3.4%