Skip to content

Commit

Permalink
Use chess960 as if kwonly
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Mar 13, 2017
1 parent c3acb05 commit 6eb72c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion chess/pgn.py
Expand Up @@ -398,7 +398,7 @@ def board(self, _cache=False):
VariantBoard = find_variant(self.headers["Variant"])

fen = self.headers.get("FEN") if self.headers.get("SetUp", "1") == "1" else None
board = VariantBoard(fen or VariantBoard.starting_fen, chess960)
board = VariantBoard(fen or VariantBoard.starting_fen, chess960=chess960)
board.chess960 = board.chess960 or board.has_chess960_castling_rights()
return board

Expand Down
10 changes: 5 additions & 5 deletions chess/variant.py
Expand Up @@ -174,7 +174,7 @@ class GiveawayBoard(SuicideBoard):
pawnless_tbz_magic = [0xe4, 0xcf, 0xe7, 0x23]

def __init__(self, fen=starting_fen, chess960=False):
super(GiveawayBoard, self).__init__(fen, chess960)
super(GiveawayBoard, self).__init__(fen, chess960=chess960)

def reset(self):
super(GiveawayBoard, self).reset()
Expand Down Expand Up @@ -337,7 +337,7 @@ class RacingKingsBoard(chess.Board):
tbw_magic = tbz_magic = None

def __init__(self, fen=starting_fen, chess960=False):
super(RacingKingsBoard, self).__init__(fen, chess960)
super(RacingKingsBoard, self).__init__(fen, chess960=chess960)

def reset(self):
self.set_fen(type(self).starting_fen)
Expand Down Expand Up @@ -418,7 +418,7 @@ class HordeBoard(chess.Board):
tbw_magic = tbz_magic = None

def __init__(self, fen=starting_fen, chess960=False):
super(HordeBoard, self).__init__(fen, chess960)
super(HordeBoard, self).__init__(fen, chess960=chess960)

def reset(self):
self.set_fen(type(self).starting_fen)
Expand Down Expand Up @@ -472,7 +472,7 @@ class ThreeCheckBoard(chess.Board):

def __init__(self, fen=starting_fen, chess960=False):
self.remaining_checks = [3, 3]
super(ThreeCheckBoard, self).__init__(fen, chess960)
super(ThreeCheckBoard, self).__init__(fen, chess960=chess960)

def reset_board(self):
super(ThreeCheckBoard, self).reset_board()
Expand Down Expand Up @@ -631,7 +631,7 @@ class CrazyhouseBoard(chess.Board):

def __init__(self, fen=starting_fen, chess960=False):
self.pockets = [CrazyhousePocket(), CrazyhousePocket()]
super(CrazyhouseBoard, self).__init__(fen, chess960)
super(CrazyhouseBoard, self).__init__(fen, chess960=chess960)

def reset_board(self):
super(CrazyhouseBoard, self).reset_board()
Expand Down
2 changes: 1 addition & 1 deletion test.py
Expand Up @@ -341,7 +341,7 @@ def test_ninesixty_castling(self):
self.assertEqual(board.shredder_fen(), fen)

fen = "Qr4k1/4pppp/8/8/8/8/8/R5KR w Hb - 0 1"
board = chess.Board(fen, True)
board = chess.Board(fen, chess960=True)

# White can just hop the rook over.
move = board.parse_san("O-O")
Expand Down

0 comments on commit 6eb72c3

Please sign in to comment.