Card Playing Simulator focused on Blackjack
Project description
CardSharp: Advanced Card Game Simulation Framework
CardSharp is a powerful Python package for simulating, analyzing, and playing card games. While it currently focuses on Blackjack, its flexible architecture allows for easy extension to other card games.
🚀 Key Features
- 🃏 Robust Blackjack simulation with multiple strategies
- 📊 Real-time visualization of game statistics
- ⚙️ Highly configurable game rules and parameters
- 🧪 Extensible framework for implementing new card games
- 🖥️ Support for both CLI and programmatic usage
- 🧮 Advanced statistical analysis of game outcomes
🛠️ Installation
# Clone the repository
git clone https://github.com/yourusername/cardsharp.git
cd cardsharp
# Create a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
# Install dependencies
pip install poetry
poetry install
🎮 Usage
CardSharp offers various modes of operation to suit different needs:
Blackjack Simulation
Run a batch simulation of Blackjack games:
python cardsharp/blackjack/blackjack.py --simulate --num_games 10000 --vis
This command simulates 10,000 games of Blackjack and displays a real-time visualization of the results.
Strategy Analysis
Compare different Blackjack strategies:
python cardsharp/blackjack/blackjack.py --analysis --num_games 5000
This runs a comparative analysis of Basic, Counting, Aggressive, and Martingale strategies over 5,000 games.
Interactive Console Mode
Play Blackjack interactively in the console:
python cardsharp/blackjack/blackjack.py --console
📁 Project Structure
cardsharp/
blackjack/
: Blackjack-specific implementationscommon/
: Shared utilities and base classeswar/
: War card game implementationhigh_card/
: High Card game implementationroulette/
: Roulette game implementation (in progress)
🧪 Testing
Run the test suite to ensure everything is working correctly:
pytest tests/
🤝 Contributing
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Run tests to ensure no regressions
- Commit your changes (
git commit -am 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🌟 Star Us!
If you find CardSharp useful, please consider giving it a star on GitHub. It helps us gain visibility and encourages further development!
📬 Contact
For questions, suggestions, or discussions, please open an issue on GitHub or contact the maintainers directly.
Happy gaming and may the odds be ever in your favor! 🎰🃏
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cardsharp-0.4.0.tar.gz
.
File metadata
- Download URL: cardsharp-0.4.0.tar.gz
- Upload date:
- Size: 32.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Darwin/24.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8392cc9a7b059f1eb793935cb6d8b2718e98497ab47e83f9c4b9a92b5f2f242 |
|
MD5 | e66fc33381ce54843f0da8804e9a2db0 |
|
BLAKE2b-256 | f7153ea650bf6b1421cca09e027d8c9e4f0ddacb80872cf21d7d612ae78919b0 |
File details
Details for the file cardsharp-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: cardsharp-0.4.0-py3-none-any.whl
- Upload date:
- Size: 38.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Darwin/24.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f70c13ae9cfd48f963e421efa43e994f0a9562e301414e0286fa6b9793a52c55 |
|
MD5 | dc6a657604ce225d0117181a8ffc88b0 |
|
BLAKE2b-256 | 208de9b8fe732db41c09fa5f8b7087d19488dee9fcdfbf03cb961c70f6ff5ef4 |