About Liar's Dice
Project Overview
Liar's Dice is a modern C++20 implementation of the classic dice game, featuring:
- Clean architecture with separation of concerns
- AI players with configurable strategies
- Comprehensive testing with Boost.Test and Robot Framework
- High-performance data structures using Boost libraries
- Advanced statistical analysis capabilities
- SIMD-optimized operations for performance
Key Features
Gameplay Features
- Multiple human and AI players
- Point-based elimination system
- Configurable game rules
- Deterministic mode for testing (seed support)
- Real-time game state tracking
AI System
- Multiple AI difficulty levels (Easy, Medium, Hard)
- Configurable AI parameters
- Statistical analysis and pattern recognition
- Bayesian probability calculations
- Opponent behavior modeling
Technical Features
- Modern C++20 with concepts and ranges
- Dependency injection architecture
- Comprehensive logging system
- Hierarchical configuration management
- Memory-efficient game state storage
- SIMD-optimized mathematical operations
Architecture
The project follows clean architecture principles:
- Core Layer: Game logic, rules, and entities
- AI Layer: Strategy pattern for AI implementations
- Infrastructure: Logging, configuration, and I/O
- Application: CLI and UI components
Performance
The game includes several performance optimizations:
- Bit-packed game state representation (8 bytes per state)
- Custom memory allocators using boost::pool
- SIMD operations with boost.simd
- Cache-efficient data structures
- Statistical accumulators for single-pass calculations
Testing
Comprehensive test coverage includes:
- Unit tests with Boost.Test
- End-to-end tests with Robot Framework
- Performance benchmarks with boost::timer
- Code coverage reporting with codecov
Building the Project
# Quick build ./build.sh # Build with specific configuration ./build.sh Debug # Run tests ./test.sh # Build documentation cmake -B build -S . -DLIARSDICE_BUILD_DOCS=ON cmake --build build --target docs
License
This project is licensed under the MIT License. See the LICENSE file for details.