allmoves list this makes copy of the actual list to store in revallmovesrather than just copy of the list reference (see to undo all the moves in allmoveswe need to perform the opposite move of the moves in allmovesand in reverse order there is list method called reverse(which will reverse the order of the items in list we call this on the revallmoves list on line the for loop on line iterates over the list of directional values rememberwe want the opposite moveso the if and elif statements from line to set the correct directional value in the oppositemove variable then we call slideanimation(to perform the animationand makemove(to update the board data structure if __name__ ='__main__' main(just like in the memory puzzle gameafter all the def statements have been executed to create all the functionswe call the main(function to begin the meat of the program that' all there is to the slide puzzle programbut let' talk about some general programming concepts that came up in this game time vs memory tradeoffs of coursethere are few different ways to write the slide puzzle game so that it looks and acts the exact same way even though the code is different there are many different ways the program that does task could be written the most common differences are making tradeoffs between execution time and memory usage usuallythe faster program can runthe better it is this is especially true with programs that need to do lot of calculationswhether they are scientific weather simulators or games with large amount of detailed graphics to draw it' also good to use the least amount of memory possible the more variables and the larger the lists your program usesthe more memory it takes up (you can find out how to measure your program' memory usage and execution time at right nowthe programs in this book aren' big and complicated enough where you have to worry about conserving memory or optimizing the execution time but it can be something to consider as you become more skilled programmer for exampleconsider the getblankposition(function this function takes time to runsince it goes through all the possible board coordinates to find where the blank space is insteadwe could just have blankspacex and blankspacey variable which would have these xy