Skip to main content

Python library for Korean chess Janggi

Project description

PyJanggi

Screen Shot 2022-06-13 at 6 04 29 PM

PyJanggi is a Python library for a Korean chess called Janggi. It provides functionalities to simulate a game, maintain a game board, list all possible moves, make a move, and validate a move.

Documentation

Check out the GitHub Page for package documentation.

Getting Started

Using PyJanggi in Your Package

  1. Install package via pip: pip install janggi

  2. Import in your Python module: import janggi

    You can also import inner modules: from janggi import JanggiGame, generate_random_game

  3. Call methods to the JanggiGame class instance to play the game.

    3 public methods are:

    • make_action(self, origin: Location, dest: Location) -> Tuple[float, bool]
    • get_all_actions(self) -> List[Tuple[Location, Location]]
    • get_all_destinations(self, origin: Location) -> List[Location]

    Check out the Documentation section for more details

    You can also check out the gym-janggi repository to learn how PyJanggi package can be utilized.

Testing Functionality

PyJanggi is originally designed to be imported by other packages and provide Janggi game logic and classes, but if you want to check if the PyJanggi package is working, you can follow these steps:

  1. Clone the repository:

    git clone https://github.com/sungho-cho/pyjanggi.git

  2. Install dependencies:

    pip install -r requirements.txt

  3. Run main.py:

    python janggi/main.py

    If you see the UI window and can navigate with left and right arrow keys, your PyJanggi package is working!

Releases

Check out the PyPi Package for releases.

License

This package is licensed under the MIT License.

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

janggi-1.0.5.tar.gz (165.3 kB view hashes)

Uploaded Source

Built Distribution

janggi-1.0.5-py3-none-any.whl (174.0 kB view hashes)

Uploaded Python 3

Supported by

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