Spaces:
Sleeping
Sleeping
Commit ·
9bf3082
1
Parent(s): 0f2511a
Update README.md with accurate Hugging Face metadata
Browse files
README.md
CHANGED
|
@@ -1,90 +1,108 @@
|
|
| 1 |
-
# Chess Engine with Stockfish Integration
|
| 2 |
-
|
| 3 |
-
---
|
| 4 |
-
title:
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
-
|
| 19 |
-
|
| 20 |
-
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
```
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Chess Engine with Stockfish Integration
|
| 2 |
+
|
| 3 |
+
---
|
| 4 |
+
title: Chess Engine with Stockfish Integration
|
| 5 |
+
tags:
|
| 6 |
+
- chess
|
| 7 |
+
- game
|
| 8 |
+
- stockfish
|
| 9 |
+
- AI
|
| 10 |
+
- engine
|
| 11 |
+
- python
|
| 12 |
+
- react
|
| 13 |
+
- typescript
|
| 14 |
+
- web
|
| 15 |
+
- cli
|
| 16 |
+
- rest-api
|
| 17 |
+
model-index:
|
| 18 |
+
- name: Stockfish
|
| 19 |
+
results:
|
| 20 |
+
- task:
|
| 21 |
+
type: chess-engine
|
| 22 |
+
metrics:
|
| 23 |
+
- name: Elo Rating
|
| 24 |
+
type: Elo
|
| 25 |
+
value: 3500+
|
| 26 |
+
sdk: docker
|
| 27 |
+
app_port: 5173
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
A Python chess engine with Stockfish integration, providing both a command-line interface and a REST API for playing chess against an AI opponent.
|
| 33 |
+
|
| 34 |
+
## Features
|
| 35 |
+
|
| 36 |
+
- **AI Integration**: Play against Stockfish, one of the strongest chess engines available
|
| 37 |
+
- **Multiple Interfaces**:
|
| 38 |
+
- Command-line interface for quick games
|
| 39 |
+
- REST API for integration with web or desktop applications
|
| 40 |
+
- Streamlit web interface for graphical gameplay
|
| 41 |
+
- **Adjustable Difficulty**: Six difficulty levels from beginner to master
|
| 42 |
+
- **Position Analysis**: Get detailed evaluation of board positions
|
| 43 |
+
- **Move Hints**: Receive suggestions and explanations for optimal moves
|
| 44 |
+
- **Notation Support**: Works with both UCI (e2e4) and SAN (e4) chess notations
|
| 45 |
+
- **Game Management**: Start, play, analyze, and save games
|
| 46 |
+
- **Comprehensive Evaluation**: Material balance, piece positioning, king safety, mobility, and pawn structure
|
| 47 |
+
|
| 48 |
+
## Requirements
|
| 49 |
+
|
| 50 |
+
- Python 3.8+
|
| 51 |
+
- Stockfish chess engine (optional, but recommended for AI play)
|
| 52 |
+
- Dependencies listed in requirements.txt
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
## API Documentation
|
| 56 |
+
|
| 57 |
+
For information please refer Dockerfile
|
| 58 |
+
|
| 59 |
+
### Example API Usage
|
| 60 |
+
|
| 61 |
+
Start a new game:
|
| 62 |
+
```bash
|
| 63 |
+
curl -X POST "http://localhost:8000/game/new" \
|
| 64 |
+
-H "Content-Type: application/json" \
|
| 65 |
+
-d '{"player_color": "white", "difficulty": "medium"}'
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
Make a move:
|
| 69 |
+
```bash
|
| 70 |
+
curl -X POST "http://localhost:8000/game/move" \
|
| 71 |
+
-H "Content-Type: application/json" \
|
| 72 |
+
-d '{"move": "e2e4"}'
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
Get current game state:
|
| 76 |
+
```bash
|
| 77 |
+
curl -X GET "http://localhost:8000/game/state"
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
## Testing
|
| 81 |
+
|
| 82 |
+
Run the test suite:
|
| 83 |
+
|
| 84 |
+
```bash
|
| 85 |
+
python test/run_tests.py
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
For more detailed output:
|
| 89 |
+
|
| 90 |
+
```bash
|
| 91 |
+
python test/run_tests.py -v
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
The test suite includes:
|
| 95 |
+
- Board representation and move validation tests
|
| 96 |
+
- Position evaluation tests
|
| 97 |
+
- Game controller tests
|
| 98 |
+
- REST API endpoint tests
|
| 99 |
+
|
| 100 |
+
## License
|
| 101 |
+
|
| 102 |
+
### Code
|
| 103 |
+
The code in this repository is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
| 104 |
+
|
| 105 |
+
### Assets
|
| 106 |
+
The chess piece images and board square assets are licensed under the Creative Commons Attribution-ShareAlike (CC-BY-SA) license. See the [LICENSE-ASSETS.md](LICENSE-ASSETS.md) file for details on attribution and compliance requirements.
|
| 107 |
+
|
| 108 |
+
**Note:** If you redistribute this project or create derivative works, you must comply with both licenses - MIT for the code and CC-BY-SA for the assets.
|