How casalta-lester/tic-toc-toe works
This is a raylib-based Tic-Tac-Toe desktop game. A player uses the GUI to log in or register, selects a mode, plays rounds, and sees match results; account credentials and computer-mode win counts persist in JSON. The principal game stages—easy AI, Minimax AI, and local two-player play—are documented, but their complete implementation is not shown in the excerpts. The sampled code shows the GUI and game logic concentrated in main.cpp, which also opens the account file and includes the JSON library. Edges use README evidence where source details were not sampled.
Main entry points: main.cpp Board play · UserInfo.JSON User records · json.hpp JSON library
Components 13
Game application
- Game screens
Tic-Toc-Toe/src/main.cpp - raylib GUI
Accounts and state
- Account flow
Tic-Toc-Toe/src/main.cpp - JSON library
Tic-Toc-Toe/src/json.hpp - User records
Tic-Toc-Toe/src/UserInfo.JSON
Match gameplay
- Mode selection
Tic-Toc-Toe/src/main.cpp - Board play
Tic-Toc-Toe/src/main.cpp - Easy computer
Tic-Toc-Toe/src/main.cpp - Minimax computer
Tic-Toc-Toe/src/main.cpp - Two players
Tic-Toc-Toe/src/main.cpp - Five-round match
Tic-Toc-Toe/src/main.cpp - Match results
Tic-Toc-Toe/src/main.cpp
Other components
- Player
Connections 13
- Player → Game screens: uses
README.md - Game screens → raylib GUI: draws GUI
Tic-Toc-Toe/src/main.cpp - Game screens → Account flow: routes screens
Tic-Toc-Toe/src/main.cpp - Account flow → JSON library: uses
Tic-Toc-Toe/src/main.cpp - Account flow → User records: reads and writes
README.md - Game screens → Mode selection: offers modes
README.md - Mode selection → Board play: starts play
Tic-Toc-Toe/src/main.cpp - Board play → Easy computer: dispatches
README.md - Board play → Minimax computer: dispatches
README.md - Board play → Two players: supports turns
README.md - Board play → Five-round match: plays rounds
README.md - Five-round match → Match results: declares outcome
README.md - Match results → User records: saves win counts
README.md