Just starting to implement AI in Tic Tac Toe. So far, it’s just stupid and choosing random squares.
Don’t understand why variables defined at beginning of program wouldn’t be available to computer_move function. Getting “cannot read property [marked] of undefined” error when computer_move function enters draw function. Compendium_of_squares is my object defined at beginning of program with name, marked, and symbol properties for each square.
Note: the error only occurs after first game with computer has been played (with user as either X or O), after reset_game function has been run.