return true on lines and if the return value of isvalidmove((now stored in tilestoflipwas falsethen makemove(will also return false otherwiseisvalidmove(returns list of spaces on the board to put down the tiles (the 'xor 'ostring in tileline sets the space that the player has moved on line ' for loop sets all the tiles that are in tilestoflip copying the board data structure def getboardcopy(board) make duplicate of the board list and return the duplicate dupeboard getnewboard( for in range( ) for in range( ) dupeboard[ ][yboard[ ][ return dupeboard getboardcopy(is different from getnewboard(getnewboad(will create blank game board data structure which has only empty spaces and the four starting tiles getboardcopy(will create blank game board data structurebut then copy all of the spaces from the board parameter this function is used by the ai to have game board that it can change around without changing the real game board this technique was also used by the previous tic tac toe program call to getnewboard(handles getting fresh game board data structure then the two nested for loops copy each of the tiles from board to the duplicate board data structure in dupeboard determining if space is on corner def isoncorner(xy) returns true if the position is in one of the four corners return ( = and = or ( = and = or ( = and = or ( = and = the isoncorner(function returns true if the coordinates are on corner space at coordinates ( , )( , )( , or ( , otherwise isoncorner(returns false