Merge pull request #1 from coding-horror/main

pull
This commit is contained in:
Anthony Rubick
2022-09-22 14:57:03 -07:00
committed by GitHub
2 changed files with 6 additions and 15 deletions

View File

@@ -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 = ""

View File

@@ -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.")