move itselfthen call slideanimation(to perform the animation on the screen because doing the slide animation does not actually update the board data structurewe update the board by calling makemove(on line we need to keep track of each of the random moves that was made so that the player can click the --solve|button later and have the program undo all these random moves (the --being smart by using stupid code|section talks about why and how we do this so the move is appended to the list of moves in sequence on line then we store the random move in variable called lastmove which will be passed to getrandommove(on the next iteration this prevents the next random move from undoing the random move we just performed all of this needs to happen numslides number of timesso we put lines to inside for loop when the board is done being scrambledthen we return the board data structure and also the list of the random moves made on it animating the board reset def resetanimation(boardallmoves) make all of the moves in allmoves in reverse revallmoves allmoves[:gets copy of the list revallmoves reverse( for move in revallmoves if move =up oppositemove down elif move =down oppositemove up elif move =right oppositemove left elif move =left oppositemove right slideanimation(boardoppositemove''int(tilesize ) makemove(boardoppositemovewhen the player clicks on --reset|or --solve||the slide puzzle game program needs to undo all of the moves that were made to the board the list of directional values for the slides will be passed as the argument for the allmoves parameter line uses list slicing to create duplicate of the allmoves list remember that if you don' specify number before the :then python assumes the slice should start from the very beginning of the list and if you don' specify number after the :then python assumes the slice should keep going to the very end of the list so allmoves[:creates list slice of the entire email questions to the authoral@inventwithpython com