Skip to content

Add Shogi implementation to OpenSpiel#1510

Closed
Arahan-kujur wants to merge 1 commit intogoogle-deepmind:masterfrom
Arahan-kujur:add-shogi-game
Closed

Add Shogi implementation to OpenSpiel#1510
Arahan-kujur wants to merge 1 commit intogoogle-deepmind:masterfrom
Arahan-kujur:add-shogi-game

Conversation

@Arahan-kujur
Copy link
Copy Markdown

This PR adds an implementation of the Shogi board game to OpenSpiel.

Features:

  • 9x9 board with standard starting position
  • piece drop mechanics
  • promotion rules
  • pawn-drop checkmate restriction
  • observation tensor support
  • undo functionality

Includes unit tests for:

  • initial state
  • pawn movement
  • capture mechanics
  • promotion
  • drop mechanics
  • action encoding
  • observation tensor

Known limitations:

  • repetition rule (sennichite) not implemented
  • entering king (nyugyoku) rule not implemented

@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 29, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@lanctot
Copy link
Copy Markdown
Collaborator

lanctot commented Mar 30, 2026

This was done in #1509 by the person who originally submitted the comment.

@Arahan-kujur
Copy link
Copy Markdown
Author

This was done in #1509 by the person who originally submitted the comment.

How would you prefer to proceed in this case? I'm happy to update my implementation, collaborate with the other contributor, or adapt it however fits best with the project.

@lanctot
Copy link
Copy Markdown
Collaborator

lanctot commented Mar 30, 2026

Thanks for the implementation.

In cases like this, I think the best thing to do is take the first implementation, especially when it's being contributed by the same person and directly in conjunction with the issue that was posted.

But this is happening a lot these days, so I will put something up in the contributor guidelines -- and maybe pin an issue -- to ensure that we don't waste time duplicating work. For future contributions (not just to OpenSpiel), please do take a look at the Pull Requests and maybe ask by posting an issue first, before you do any work.

If you're still interested in contributing a sizeable controbution to OpenSpiel, please either respond to an existing issue or opening an issue to discuss it first.

@lanctot
Copy link
Copy Markdown
Collaborator

lanctot commented Mar 30, 2026

Given the frequency of the PR duplication over the past few months, I've added the following issue:

#1511

I've pinned it to the Issues page so hopefully that helps with awareness. Sorry for the time you spent working on this. There are other games we would be interested in if you're still interested.. take a look at #843 .

@lanctot lanctot closed this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants