Python Kriegspiel Game
Project description
kriegspiel
Python game engine for the Berkeley Kriegspiel referee rules.
Current scope:
- Berkeley Kriegspiel
- Berkeley + Any
The package models the referee, not a UI. You interact with it by asking questions as KriegspielMove objects and reading KriegspielAnswer results.
Install
pip install kriegspiel
Quick Start
import chess
from kriegspiel.berkeley import BerkeleyGame
from kriegspiel.move import KriegspielMove, QuestionAnnouncement
game = BerkeleyGame(any_rule=True)
question = KriegspielMove(
QuestionAnnouncement.COMMON,
chess.Move.from_uci("e2e4"),
)
answer = game.ask_for(question)
print(answer.main_announcement)
print(answer.special_announcement)
game.save_game("game.json")
loaded = BerkeleyGame.load_game("game.json")
Main Concepts
BerkeleyGame: the referee and full hidden board stateKriegspielMove: a player question, either a normal move orASK_ANYKriegspielAnswer: the referee response, including move outcome, captures, and special announcements
Links
- PyPI: kriegspiel
- Issues: github.com/Kriegspiel/ks-game/issues
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kriegspiel-1.2.3.tar.gz
(27.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kriegspiel-1.2.3.tar.gz.
File metadata
- Download URL: kriegspiel-1.2.3.tar.gz
- Upload date:
- Size: 27.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36f46a843fa5c799432786e57abeb72fafc90b3be5b3fbe4918a8cb1eb5c8d13
|
|
| MD5 |
6efe7f70bdaac20a4bda8081cc8fd5bd
|
|
| BLAKE2b-256 |
44fb31635a2feb347dc26cf595795fe2051a1d64f29e587e243e038f9d85346b
|
File details
Details for the file kriegspiel-1.2.3-py3-none-any.whl.
File metadata
- Download URL: kriegspiel-1.2.3-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f635f7ed79db9da376d3c3cae78c02b69f2710efa35ece55b7685d93eeaecd0
|
|
| MD5 |
decc55ba19b656c09f5dc3a40ff38b45
|
|
| BLAKE2b-256 |
f1e349a60d2609a15a2c89d3040e18156851bd1043ae9f4fd79d6bae9e80d47c
|