I think its a global or local error but I dont get it.
def who_wins_when_player_3(player):
if player == 3:
amount_triangles = np.count_nonzero(board == 3)
if amount_triangles == 3 or 5 or 7:
player = 2
else:
player = 1
here it doesn't work:
# vertical win check
for col in range(BOARD_COLS):
if board[0][col] == player and board[1][col] == player and board[2][col] == player or board[3][col] == player and board[1][col] == player and board[2][col] == player:
who_wins_when_player_3()
print(f"Player {player} wins")
return True
here it works:
# vertical win check
for col in range(BOARD_COLS):
if board[0][col] == player and board[1][col] == player and board[2][col] == player or board[3][col] == player and board[1][col] == player and board[2][col] == player:
if player == 3:
amount_triangles = np.count_nonzero(board == 3)
if amount_triangles == 3 or 5 or 7:
player = 2
else:
player = 1
print(f"Player {player} wins")
return True
where is the error?
Best regards