/Shogi

Command-line Shogi game

Primary LanguagePython

EventbriteShogi

Command-line Shogi game

MIT License

Table of Contents

About the project

This project is an implementation of a Shogi (Japanese chess) game aimed at showcasing object-oriented design and object-oriented programming principles.

As it stands, it provides a client to play the game through a command-line interface, but it's easily adaptable to other interfaces in the future. The implemented features include:

  • Piece movement, including capturing opposing pieces, but without piece promotion abilities
  • Dropping of captured pieces

The code has been structured to follow a rough hexagonal architecture, separating Domain, Application (use cases) and Infrastructure (interface) concerns. It also includes unit tests for Domain classes.

Built With

Getting Started

Prerequisites

You must have Python 3.* installed.

Installation

  1. Clone the repo
git clone https://github.com/Urbistondo/Shogi.git

Usage

To run the game, navigate to src/ and run the Main.py file

cd src
python Main.py

To move a piece, you must provide the coordinates to choose a piece the same color as the color of the current player, and the coordinates of the square to which you wish to move the piece, with the following format:

From (row col):
20
To (row col):
30

This will move the piece at row 2 and column 0 to the square at row 3 and column 0.

Captured pieces appear above the board for the white player and below it for the black one, and is refered to as line 9. To drop a captured piece on the board, select it like so:

From (row col):
91
To (row col):
44

Assuming you have captured pieces, this command will drop the second captured piece in square at row 4 and column 4 as long as said square is empty.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Javier Urbistondo - @JaviUrbistondo

Project Link: https://github.com/Urbistondo/Shogi