Design a Tic Tac Toe Game
EasyGamesStrategyObserver
Problem Statement
Design a Tic Tac Toe game system that supports:
- Two human players (or one human vs. AI)
- N×N board (default 3×3, extendable)
- Win detection (row, column, diagonal)
- Draw detection
- Game reset
Design Requirements
Key Entities:
Game— Controls game flowBoard— N×N gridPlayer— Human or AI playerMove— A position (row, col)GameStatus— InProgress, Win, Draw
Key Behaviors:
makeMove(player, row, col)→ applies move, returns GameStatusisWinner(player)→ checks if player has wonisDraw()→ board is full without winnerreset()→ clears board for new game
!Constraints
- Board size N is 3–10
- Win requires N in a row (same as board size)
- A cell can only be claimed once
- Players alternate turns — enforce turn order
- Support both 2-player and player vs AI modes
Output
Run your code to see output here.