From 6eb72c31d137aaee576440dfd50476338dbc9a48 Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Fri, 10 Mar 2017 01:12:53 +0100 Subject: [PATCH] Use chess960 as if kwonly --- chess/pgn.py | 2 +- chess/variant.py | 10 +++++----- test.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/chess/pgn.py b/chess/pgn.py index 2e3f2306b..3b7dd6d1c 100644 --- a/chess/pgn.py +++ b/chess/pgn.py @@ -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 diff --git a/chess/variant.py b/chess/variant.py index e8a8cc9f1..c4e6f9808 100644 --- a/chess/variant.py +++ b/chess/variant.py @@ -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() @@ -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) @@ -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) @@ -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() @@ -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() diff --git a/test.py b/test.py index 2c8c38049..e09147062 100755 --- a/test.py +++ b/test.py @@ -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")