[Shogi] Randomly initialize the current_player variable.#1298
Merged
sotetsuk merged 1 commit intosotetsuk:mainfrom Feb 16, 2025
Merged
[Shogi] Randomly initialize the current_player variable.#1298sotetsuk merged 1 commit intosotetsuk:mainfrom
current_player variable.#1298sotetsuk merged 1 commit intosotetsuk:mainfrom
Conversation
Contributor
Author
|
Hmm, the test on 3.13 has failed. Maybe these failures are not caused by the modification in this pull request...? |
Owner
|
Thank you again for reporting bugs! Recent changes may have introduced this bug ... 😢 |
Contributor
Author
|
Thank you for your kind and quick reply! |
Contributor
Author
|
Thank you for releasing v2.6.0! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for developing your nice library. I am really enjoying using it.
Issue
In Shogi environment,
current_playeris not randomly initialized.This can cause issues when the users use the information of
current_playerin their code.The following code can reproduce this issue.
Reason
In the
_initfunction of pgx/pgx/shogi.py, the variableplayer_orderis randomly initialized, but it is not reflected to the variablecurrent_player.Therefore,
current_playerstays to bejnp.int32(0), as initialized in class definition.Proposal
I propose to initialize the
current_playervariable in the_initfunction.Specifically, I propose to copy and paste the
_initfunction in chess.py into shogi.py.