How loks0n/rapid-draughts works
rapid-draughts is a TypeScript draughts/checkers engine implementing English draughts under WCDF rules. The main workflow is to set up a game, expose legal moves and board state, accept a move, and update game history; callers can also request moves from random or alpha-beta computer opponents. Internally, the generic game and engine layers separate the 1D public representation from bitboard rules. The README also documents bitboard-based performance and AI; unsampled modules are included where their role is supported by the source index, but their internal call paths are not inferred.
Main entry points: engine.ts Generic Engine · core/game.ts Game State and History · computer.ts English Computer Factory · english/game.ts English Game API
Components 15
Game Interface
- English Game API
src/english/game.ts - Game State and History
src/core/game.ts - Board Formatting
src/core/utils.ts
English Rules
- English Rules Engine
src/english/engine.ts - Move Generation
src/english/move-generation.ts - Board Masks
src/english/mask.ts
Engine Core
- Generic Engine
src/core/engine.ts
Computer Players
- Computer Strategy API
src/computer/computer.ts - English Computer Factory
src/english/computer.ts - Alpha-Beta Search
src/computer/alpha-beta.ts - Random Strategy
src/computer/random.ts
Bitboard Operations
- Number Bitboards
src/bitwise/number.ts - Long Bitboards
src/bitwise/long.ts - Bitboard Types
src/bitwise/types.ts
Other components
- Library Caller
Connections 20
- Library Caller → English Game API: sets up
README.md - Library Caller → Game State and History: plays moves
README.md - English Game API → Generic Engine: creates
src/english/game.ts - English Game API → Game State and History: constructs
src/english/game.ts - Game State and History → Generic Engine: delegates moves
src/core/game.ts - Game State and History → Board Formatting: formats board
src/core/game.ts - Generic Engine → English Rules Engine: uses strategy
src/english/engine.ts - English Rules Engine → Move Generation: requests moves
src/english/engine.ts - English Rules Engine → Board Masks: uses masks
src/english/engine.ts - Move Generation → Board Masks: uses masks
src/english/move-generation.ts - English Computer Factory → Computer Strategy API: builds opponents
src/english/computer.ts - English Computer Factory → Alpha-Beta Search: selects strategy
src/english/computer.ts - English Computer Factory → Random Strategy: selects strategy
src/english/computer.ts - Computer Strategy API → Generic Engine: passes engine
src/computer/computer.ts - Computer Strategy API → Game State and History: adapts move
src/computer/computer.ts - Alpha-Beta Search → Generic Engine: searches positions
src/computer/alpha-beta.ts - Random Strategy → Generic Engine: chooses legal move
src/computer/random.ts - Number Bitboards → Bitboard Types: implements operations
src/bitwise/number.ts - Long Bitboards → Bitboard Types: implements operations
src/bitwise/long.ts - English Computer Factory → Library Caller: offers AI moves
README.md