Skip to main content

A Pythonic wargame engine for Guy Debord's Le Jeu de la Guerre

Project description

Pykrieg

PyPI Version Documentation License

A Pythonic wargame engine for Guy Debord's Le Jeu de la Guerre (A Game of War).

About

Pykrieg is a Python library that implements the complex rules of Guy Debord's strategic tabletop game, providing a clean, extensible API for developers to build custom interfaces, AI opponents, and analysis tools. The project is inspired by the successful python-chess library and follows similar design principles.

Installation

pip install pykrieg

For console interface with mouse support:

pip install pykrieg[console]

Features

  • Complete Game Engine: Full implementation of Debord's strategic game rules
  • Format Support: KFEN format for saving/sharing games
  • Console Interface: Interactive terminal-based gameplay
  • Protocol Support: UCI-like protocol for engine-frontend communication (v0.3.0)

Quick Start

Console Interface (Casual Players)

Launch the interactive console game:

python -m pykrieg.console

Play using simple commands:

  • move 5,10 6,10 - Move a unit
  • attack 5,12 - Attack a target
  • pass - Skip attack phase
  • end - End turn
  • help - Show all commands

Python API (Developers)

from pykrieg import Board

# Create a board
board = Board()

# Add units
board.create_and_place_unit(5, 10, 'INFANTRY', 'NORTH')

# Move a unit
board.make_turn_move(5, 10, 6, 10)

# Attack
board.switch_to_battle_phase()
result = board.make_turn_attack(1, 12)

# End turn
board.end_turn()

Donations

If you like the project and want to support future development, consider donating!

Donate with PayPal

License

This project is licensed under the GNU General Public License v3.0 - see LICENSE for details.

The GPL v3 license ensures that:

  • The software remains free for all users
  • Commercial use is permitted, including selling the software or offering it as a service
  • Derivative works must be shared under the same license (copyleft)
  • Users have the freedom to study, modify, and distribute the software

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

pykrieg-0.3.0.tar.gz (147.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pykrieg-0.3.0-py3-none-any.whl (66.0 kB view details)

Uploaded Python 3

File details

Details for the file pykrieg-0.3.0.tar.gz.

File metadata

  • Download URL: pykrieg-0.3.0.tar.gz
  • Upload date:
  • Size: 147.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for pykrieg-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e679da1b9c6f5e72c2a84864f75684f5e84bc03c9a7eb75fec459758f7e28ce6
MD5 3b2491fdf9d26966574ea57d06a9e7a0
BLAKE2b-256 d1dcf4accf01b36e61e5e1dafd5e0184b5d025970b135fdbf480a5458fd17a61

See more details on using hashes here.

File details

Details for the file pykrieg-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pykrieg-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 66.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for pykrieg-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 acda55c626682e9780adeb880c31b4e43d2ead198b3979e19ae6db5665f1790d
MD5 23c812ae54d2cf723389a7282c149a1c
BLAKE2b-256 cba100b2efb4c8c44548af89de473cb61780098b1eb2ef1bcdefe6a009d39bd1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page