continue else: move_num += 1 #current board is the integer representation of the game board based on given game move fen_board = convert(board.fen()) #update game image with current board (users move) game_image = update_image(game_image, fen_board, move_num) #user move, board update print("Your move:\n") print(board) '''Computer Move''' #update game_image with trained model. play(args, new_gameboard, move_num) returns the game board #the model wants to use in integer 2d representation. #computer moved predicted_board = dcgan.play(args,game_image,move_num + 1) legal_moves, legal_boards = get_legals(board) #list of all max differences for each cooresponding legal board and the predicted_board max_differences = [max_diff(predicted_board,legal_board) for legal_board in legal_boards] #get the index of the smallest value in max_differences best_difference = min(max_differences) best_index = max_differences.index(best_difference) #best move and board based on the best index best_move = legal_moves[best_index] best_board = legal_boards[best_index] board.push(best_move) game_image = update_image(game_image,best_board,move_num) print('\n',board) print("Computer Move:",best_move,'\n')