How lk16/swap works
Main Components
a) Frontend Layer:
• Web interface (assets/index.html, assets/app.js, assets/styles.css)
• WebSocket client connection for real-time game updates
b) Backend Server:
• Rust-based server implementation
• WebSocket server component (src/frontend/websocket.rs)
• Application logic handler (src/frontend/app.rs)
c) Game Engine Core:
• Othello game logic (src/othello/)
• Board representation
• Move generation and validation
• Evaluation
d) AI Systems:
1. Edax Bot (src/bot/edax/)
2. Squared Bot (src/bot/squared/)
• Random Bot as a simple alternative
Component Relationships
• Frontend ↔ Backend Server (WebSocket connection)
• Backend Server → Game Engine (game state management)
• Game Engine → AI Systems (position evaluation requests)
• AI Systems → Game Engine (move responses)
Detailed Component Breakdown
Game Engine (src/othello/):
┌─────────────────────────┐
• Game Engine │
• ┤
• Board Representation │
• Move Generation │
• Position Evaluation │
• Game State Management │
• ┘
AI Systems (src/bot/):
┌─────────────────────┐ ┌─────────────────────┐
• Edax Bot │ │ Squared Bot │
• ┤ ├─────────────────────┤
• Midgame Logic │ │ - Midgame Logic │
• Evaluation │ │ - Endgame Logic │
• Weights │ └─────────────────────┘
• ┘
Implementation Details to Highlight
• Multiple move generation strategies:
• Edax bitscan
• Simple implementation
• Edax slow
• Separation between midgame and endgame logic in the AI systems
• Weight-based evaluation system in the Edax bot