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
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
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.