How jp987654/omok-lab works
This is a PHP Omok (Gomoku) web service. A client requests game information or creates a game, then submits moves using a game ID; the service applies the player's move, asks the selected strategy for a computer reply when needed, and persists the updated board as JSON. The graph covers the documented endpoints and the sampled game, board, and strategy layers. The README only gives launch commands, so no client-to-endpoint integration is asserted.
Main entry points: Game.php Game Logic · Strategies.php Strategy Registry · Board.php Board Rules · index.php Game Info
Components 12
HTTP API
- Game Info
info/index.php - New Game
new/index.php - Play Move
play/index.php - JSON Helpers
lib/common.php
Game State
- Game Logic
lib/Game.php - Board Rules
lib/Board.php - JSON Save Files
lib/Game.php
Move Strategies
- Strategy Registry
lib/Strategies.php - Move Contract
lib/MoveStrategy.php - Random Strategy
lib/RandomStrategy.php - Smart Strategy
lib/SmartStrategy.php
Other components
- HTTP Caller
Connections 21
- HTTP Caller → Game Info: requests info
info/index.php - HTTP Caller → New Game: creates game
new/index.php - HTTP Caller → Play Move: submits move
play/index.php - Game Info → JSON Helpers: loads helpers
info/index.php - Game Info → Board Rules: reports size
info/index.php - Game Info → Strategy Registry: lists strategies
info/index.php - New Game → JSON Helpers: loads helpers
new/index.php - New Game → Strategy Registry: validates strategy
new/index.php - New Game → Game Logic: creates and saves
new/index.php - Play Move → JSON Helpers: loads helpers
play/index.php - Play Move → Game Logic: loads and moves
play/index.php - Play Move → Board Rules: checks vacancy
play/index.php - Game Logic → Board Rules: updates and checks
lib/Game.php - Game Logic → Strategy Registry: creates strategy
lib/Game.php - Game Logic → JSON Save Files: reads and writes
lib/Game.php - Strategy Registry → Random Strategy: instantiates
lib/Strategies.php - Strategy Registry → Smart Strategy: instantiates
lib/Strategies.php - Random Strategy → Move Contract: implements
lib/RandomStrategy.php - Random Strategy → Board Rules: chooses empty cell
lib/RandomStrategy.php - Smart Strategy → Random Strategy: falls back to
lib/SmartStrategy.php - Smart Strategy → Board Rules: evaluates lines
lib/SmartStrategy.php