Aug-16-2019, 11:38 AM
I am stuck in a loop where I cannot move onto player 2 selection. (im in the early stage and I am only onto the validation checking so far):
import numpy as np turn = 0 game_over = False def board_create(column, row): board = np.zeros((row,column)) return board def is_valid_location(column_choice, board, bottom_row): if board[bottom_row][column] == 0: return False else: return True row = 5 #row = int(input("How many rows: ")) column = int(input("How many columns: ")) board = board_create(column, row) while not game_over: if turn == 0: invalid = True bottom_row = 0 while invalid == True: column = column - 1 column = str(column) column_choice = int(input("Player 1 make your selection (0-"+column+"):")) column = int(column) invalid = is_valid_location(column_choice, board, bottom_row) column = column + 1 else: while invalid == True: column = column - 1 column = str(column) column_choice = int(input("Player 2 make your selection (0-"+column+"):")) column = int(column) invalid = is_valid_location(column_choice, board, bottom_row) column = column + 1 turn = turn + 1 turn = turn % 2Would be thankful for any help given