Aug-14-2019, 01:31 PM
(This post was last modified: Aug-14-2019, 01:38 PM by Help_me_Please.)
Can I please have some help, I am passing in variables correctly and I am trying to check if the column is within the correct table (6 by 6) and I am returning board but the error I get is this:
line 29, in <module>
is_valid_location(board, column, invalid)
NameError: name 'board' is not defined
line 29, in <module>
is_valid_location(board, column, invalid)
NameError: name 'board' is not defined
turn = 0 row = 6 columns = 6 invalid = True game_over = False def board_create(columns, row): board = [[' '] * columns for row in range(row)] return board def drop_piece(): pass def is_valid_location(board, column): if column > 6 or column <= 0: invalid = True def get_next_open_row(): pass board_create(columns, row) while not game_over: if turn == 0: while invalid == True: column = input("Player 1 make your selection (1-6):") is_valid_location(board, column, invalid) else: while invalid == True: column = input("Player 2 make your selection (1-6):") is_valid_location(board, column, invalid) turn = turn + 1 turn = turn % 2Would appreciate some help.