Python library for Korean chess Janggi
Project description
PyJanggi
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
-
Install package via pip:
pip install janggi
-
Import in your Python module:
import janggi
You can also import inner modules:
from janggi import JanggiGame, generate_random_game
-
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:
-
Clone the repository:
git clone https://github.com/sungho-cho/pyjanggi.git
-
Install dependencies:
pip install -r requirements.txt
-
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
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
Built Distribution
File details
Details for the file janggi-1.0.5.tar.gz
.
File metadata
- Download URL: janggi-1.0.5.tar.gz
- Upload date:
- Size: 165.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4c9c5fa15b11b3a72886061cb46cde49bd4275f440ff1ea9ea079cebef58e04 |
|
MD5 | 25917d9a249db2b5c5265f7af542d2a3 |
|
BLAKE2b-256 | 8c7266f0f3bd9caefd9c0173b15d552ef2be28254719077fbfc6d862fc074e0f |
File details
Details for the file janggi-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: janggi-1.0.5-py3-none-any.whl
- Upload date:
- Size: 174.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e24f8909e20a45f18d25e71155c89eacf5ada5258d66056c20608c2a5ec09f31 |
|
MD5 | fc8feb7c28f993a7c7964fd988311ec7 |
|
BLAKE2b-256 | b48a49d4506820c92aeaaaa57a39470445a628c047ec0bf3036d4f1be4ca6396 |