Jan-20-2021, 10:37 PM
This part of the code is pretty horrible:
if turn == 0: col = int(input('Player 1 make your Selection (0-6)')) if is_valid_location(board, col): row = get_next_open_row(board, col) drop_piece(board, row, col, 1) if winning_move(board, 1): print('Player 1 win !!') game_over = True # Ask for player 2 input else: col = int(input('Player 2 make your Selection (0-6)')) if is_valid_location(board, col): row = get_next_open_row(board, col) drop_piece(board, row, col, 2) if winning_move(board, 1): print("Player 1 wins !!") game_over = TrueDo you notice anything about this code? Anything, repetitive? Like the code for the first player and the second player being identical except the first player is "1" and the second player is "2"? Do you think you could improve upon this code by removing all the duplicate code and make a more generic coding that works for both player 1 and player 2? At least then you wouldn't be blatantly plagiarizing if you turned this in.