the first boxes in this list (and each group of boxes afterwards)it will be random group of boxes to get the lists of boxeswe call our splitintogroupsof(functionpassing and the list in boxes the list of lists that the function returns will be stored in variable named boxgroups revealing and covering the groups of boxes drawboard(boardcoveredboxesfor boxgroup in boxgroupsrevealboxesanimation(boardboxgroupcoverboxesanimation(boardboxgroupfirstwe draw the board since every value in coveredboxes is set to falsethis call to drawboard(will end up drawing only covered up white boxes the revealboxesanimation(and coverboxesanimation(functions will draw over the spaces of these white boxes the for loop will go through each of the inner lists in the boxgroups lists we pass these to revealboxesanimation()which will perform the animation of the white boxes being pulled away to reveal the icon underneath then the call to coverboxesanimation(will animate the white boxes expanding to cover up the icons then the for loop goes to the next iteration to animate the next set of boxes the "game wonanimation def gamewonanimation(board) flash the background color when the player has won coveredboxes generaterevealedboxesdata(true color lightbgcolor color bgcolor for in range( ) color color color color swap colors displaysurf fill(color drawboard(boardcoveredboxes pygame display update( pygame time wait( when the player has uncovered all of the boxes by matching every pair on the boardwe want to congratulate them by flashing the background color the for loop will draw the color in the color variable for the background color and then draw the board over it howeveron each iteration of the for loopthe values in color and color will be swapped with each other email questions to the authoral@inventwithpython com