How huxin0817/dots-and-boxes works
Dots and Boxes is a browser game: players choose edges, the board updates scores and turns, and the game ends with a result and restart option. Robot turns are dispatched to a web worker, which reconstructs the board and asks the search-based robot for a move. The graph follows the supplied source excerpts; the README is empty, and some robot implementation lines were omitted, so uncertain internal search wiring is not expanded.
Main entry points: App.jsx Game controller · robot-worker.js Robot worker · robots.js Move search · config.js Player settings
Components 12
Game interface
- React entry
src/main.jsx - Game controller
src/App.jsx - Board and result UI
src/App.jsx
Game model
- Player settings
src/config.js - Board topology
src/game/board-topology.js - Live game state
src/game/board.js
Robot play
- Robot worker
src/game/robot-worker.js - Move search
src/game/robots.js - Search state
src/game/search-board.js - Exact-search cache
src/game/search-cache.js - Random selection
src/game/random.js
Other components
- Player
Connections 16
- Player → Board and result UI: selects edge
- React entry → Game controller: renders
- Game controller → Player settings: reads settings
- Player settings → Move search: parses player type
- Game controller → Live game state: updates or resets
- Game controller → Board topology: creates model
- Game controller → Board and result UI: renders state
- Board and result UI → Game controller: edge click
- Game controller → Robot worker: dispatches snapshot
- Robot worker → Live game state: replays moves
- Robot worker → Board topology: creates model
- Robot worker → Move search: requests move
- Move search → Search state: evaluates positions
- Move search → Exact-search cache: looks up positions
- Move search → Random selection: selects randomly
- Robot worker → Game controller: returns edge