# DO NOT EDIT THE FOLLOWING LINES # COURSE CPSC 217 July 2025 # INSTRUCTOR: Jonathan Hudson # 8yUgc1YHiRNkY9dhladt # DO NOT EDIT THE ABOVE LINES # TODO: INFORMATION FOR YOUR TA # Constants for the game pieces EMPTY = 0 X_PIECE = 1 O_PIECE = 2 # # TODO: Insert your implementation of create_board here (code and comments (in-line and above function)) # # # TODO: Insert your implementation of row_count here (code and comments (in-line and above function)) # # # TODO: Insert your implementation of column_count here (code and comments (in-line and above function)) # # # TODO: Insert your implementation of can_play here (code and comments (in-line and above function)) # # # TODO: Insert your implementation of play here (code and comments (in-line and above function)) # # # TODO: Replace this with your implementation of full here (code and comments (in-line and function)) # def full(board): return True # # TODO: Insert your implementations of win_in_row (code and comments (in-line and function)) # # # TODO: Insert your implementations of win_in_column here (code and comments (in-line and function)) # # # TODO: Insert your implementations of win_in_diagonal_backslash here (code and comments (in-line and function)) # # # TODO: Insert your implementations of win_in_diagonal_forward_slash here (code and comments (in-line and function)) # # # TODO: Replace this with your implementation of won here (code and comments (in-line and function)) # def won(board, piece): return False # # TODO: Replace this with your implementation of hint here (code and comments (in-line and function)) # def hint(board, piece): return -1, -1 ############################################################################## # # Code below is for testing student functions (IF YOU ARE READING THIS YOU BETTER NO BE CHANGING CODE DOWN HERE) # ############################################################################## def game_over(board): """ This function determines if the game is complete due to a win or tie by either player :param board: The 2D list board to check :return: True if game is complete, False otherwise """ if full(board) or won(board, X_PIECE) or won(board, O_PIECE): return True return False if __name__ == '__main__': print("File is being run directly so ask about running the tests.") if input("Enter Y to run tests:") == "Y": from CPSC217S25A3Test import * run_tests()