From 6e1d38918abdd65ad25ae1bd64e020aaf6059abc Mon Sep 17 00:00:00 2001 From: Andrei Ursu Date: Mon, 5 Sep 2022 23:52:21 +0200 Subject: [PATCH 1/2] Fix qubit.py Changed the following lines: 284: typo of function call. 316: typo of function call. --- 88_3-D_Tic-Tac-Toe/python/qubit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/88_3-D_Tic-Tac-Toe/python/qubit.py b/88_3-D_Tic-Tac-Toe/python/qubit.py index 5f2f0e77..3a8f1e09 100644 --- a/88_3-D_Tic-Tac-Toe/python/qubit.py +++ b/88_3-D_Tic-Tac-Toe/python/qubit.py @@ -281,7 +281,7 @@ class TicTacToe3D: class Qubit: def move_code(self, board, m) -> str: - x, y, z = board.get3DPosition(m) + x, y, z = board.get_3d_position(m) return f"{z + 1:d}{y + 1:d}{x + 1:d}" def show_win(self, board, i) -> None: @@ -313,7 +313,7 @@ class Qubit: x = c.find(h[2]) y = c.find(h[1]) z = c.find(h[0]) - if board.move3D(x, y, z, Player.HUMAN): + if board.move_3d(x, y, z, Player.HUMAN): break print("That square is used. Try again.") From 6ef7b1fc05eebeb96adaae618217593775c69385 Mon Sep 17 00:00:00 2001 From: Andrei Ursu Date: Tue, 6 Sep 2022 01:40:49 +0200 Subject: [PATCH 2/2] Fix life_for_two.py compile error. It seems like it will always give a build error even if you don't touch this specific file, so I initialized everything at the start. --- 56_Life_for_Two/python/life_for_two.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/56_Life_for_Two/python/life_for_two.py b/56_Life_for_Two/python/life_for_two.py index a79be546..e2116826 100644 --- a/56_Life_for_Two/python/life_for_two.py +++ b/56_Life_for_Two/python/life_for_two.py @@ -6,24 +6,15 @@ Competitive Game of Life (two or more players). Ported by Sajid Sarker (2022). ''' # Global Variable Initialisation -gn = [] -gx = [] -gy = [] +# Initialise the board +gn = [[0 for i in range(6)] for j in range(6)] +gx = [0 for x in range(3)] +gy = [0 for x in range(3)] gk = [0, 3, 102, 103, 120, 130, 121, 112, 111, 12, 21, 30, 1020, 1030, 1011, 1021, 1003, 1002, 1012] ga = [0, -1, 0, 1, 0, 0, -1, 0, 1, -1, -1, 1, -1, -1, 1, 1, 1] m2 = 0 m3 = 0 -# Initialise the board -for j in range(6): - gn.append([]) - for k in range(6): - gn[j].append(0) - -for i in range(3): - gx.append(0) - gy.append(0) - # Helper Functions def tab(number) -> str: t = ""