From 2b754a25854b41c68a847c5c36439f2eb1cdffb2 Mon Sep 17 00:00:00 2001 From: anonymousdouble <112695649+anonymousdouble@users.noreply.github.com> Date: Mon, 1 Jan 2024 21:15:29 +1100 Subject: [PATCH] Update gaviota.py refactor with chain constant value assignment to make code more Pythonic, concise and efficient. --- chess/gaviota.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/chess/gaviota.py b/chess/gaviota.py index 15371eb19..39173b593 100644 --- a/chess/gaviota.py +++ b/chess/gaviota.py @@ -144,8 +144,7 @@ def init_flipt() -> List[List[int]]: def init_pp48_idx() -> Tuple[List[List[int]], List[int], List[int]]: - MAX_I = 48 - MAX_J = 48 + MAX_I = MAX_J = 48 idx = 0 pp48_idx = [[-1] * MAX_J for _ in range(MAX_I)] pp48_sq_x = [NOSQUARE] * MAX_PP48_INDEX @@ -170,9 +169,7 @@ def init_pp48_idx() -> Tuple[List[List[int]], List[int], List[int]]: def init_ppp48_idx() -> Tuple[List[List[List[int]]], List[int], List[int], List[int]]: - MAX_I = 48 - MAX_J = 48 - MAX_K = 48 + MAX_I = MAX_J = MAX_K = 48 ppp48_idx = [[[-1] * MAX_I for _ in range(MAX_J)] for _ in range(MAX_K)] ppp48_sq_x = [NOSQUARE] * MAX_PPP48_INDEX ppp48_sq_y = [NOSQUARE] * MAX_PPP48_INDEX