Commit Graph

9 Commits

Author SHA1 Message Date
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
Jannis Heydemann
c057c9f3c1 Merge branch 'master' of ssh://gitea.starfour.de:2222/Berufsschule/tictactoe 2026-04-23 12:51:32 +02:00
Jannis Heydemann
cfbf7e9974 switched from strings to chars 2026-04-23 12:50:02 +02:00
6442bf6b6d Update README.md 2026-04-23 10:26:31 +00:00
2a74965a97 finished wincheck and system detection 2026-04-23 07:39:22 +02:00
4d12622a41 Added the game state and started work on the win check. worked as described in #1 2026-04-22 16:21:49 +02:00
Jannis Heydemann
7c15d4ccc2 added CONTRIBUTING.md file 2026-04-22 15:40:45 +02:00
Jannis Heydemann
3121d26995 added readme 2026-04-22 15:35:01 +02:00
Jannis Heydemann
c68ba4e9dd added first game rendering engine 2026-04-22 15:13:33 +02:00