How coen-potgieter/chess-encoding works
Main Components
a) Client-Side Components:
• Message Input/Output System
• Encryption/Decryption Engine
• Chess Game Generator
• Lichess Bot Interface
b) External Services:
• Lichess.org API
• Bot Accounts (2 separate bots)
Specific Component Details
a) File System Component (Yellow):
• Hierarchy: data/<folder_name>/{secret.txt, played-games, predefined-moves}
• Storage for moves.json and ids.json
b) Processing Pipeline (Green):
• Text to Binary Converter
• Binary to Chess Move Encoder
• Chess Move to Binary Decoder
• Binary to Text Converter
c) Bot System (Purple):
• Bot A Controller (play_a.py)
• Bot B Controller (play_b.py)
• Bot Synchronization Mechanism
d) API Integration (Red):
• Lichess.org API Interface
• Game State Tracker
• Move Validator
Key Processes to Highlight
a) Encryption Process:
1. Read secret.txt
2. Convert to binary
3. Generate chess moves
4. Store in moves.json
b) Game Execution:
1. Bot A reads moves
2. Bot B responds
3. Game ID storage
4. PGN retrieval
c) Decryption Process:
1. Load PGN files
2. Extract moves
3. Convert to binary
4. Recover message
Additional Elements
• Version/state information for key components
• Error handling paths
• Configuration dependencies
Technical Details to Note
• File formats (PGN, JSON, TXT)
• API endpoints
• Asynchronous operations
• Security boundaries