-xdirection -ydirection if =xstart and =ystartbreak tilestoflip append([xy]line ' while loop stops looping when the code has reached the end of the othertile tiles line checks if this space on the board holds one of our tiles if it doesthen the move originally passed to isvalidmove(is valid line loops by moving and in reverse back to the original xstart and ystart position by subtracting and each space is appended to the tilestoflip list board[xstart][ystartrestore the empty space if len(tilestoflip= if no tiles were flippedthis is not valid move return false return tilestoflip the for loop that started on line does this in all eight directions after that loop is donethe tilestoflip list will contain the xy coordinates all of our opponent' tiles that would be flipped if the player moved on xstartystart rememberthe isvalidmove(function is only checking to see if the original move was valid it doesn' actually permanently change the data structure of the game board if none of the eight directions ended up flipping at least one of the opponent' tilesthen tilestoflip will be an empty list this is sign that this move is not valid and isvalidmove(should return false otherwiseisvalidmove(returns tilestoflip checking for valid coordinates def isonboard(xy) returns true if the coordinates are located on the board return > and and <= isonboard(is function called from isvalidmove(calling the function is shorthand for the boolean expression on line that is true if both and are between and this function post questions to