Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
sotetsuk committed Oct 30, 2024
1 parent ddbabf3 commit e60f647
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pgx/shogi.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,7 @@ def _is_promotion_legal(
piece = state._x.board[from_]
# promotion
is_illegal = (GOLD <= piece) & (piece <= DRAGON) # Pieces cannot promote
is_illegal |= (from_ % 9 >= 3) & (
to % 9 >= 3
) # irrelevant to the opponent's territory
is_illegal |= (from_ % 9 >= 3) & (to % 9 >= 3) # irrelevant to the opponent's territory
return ~is_illegal


Expand Down

0 comments on commit e60f647

Please sign in to comment.