From 6ef7b1fc05eebeb96adaae618217593775c69385 Mon Sep 17 00:00:00 2001 From: Andrei Ursu Date: Tue, 6 Sep 2022 01:40:49 +0200 Subject: [PATCH] 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 = ""