return board the data structure used for the board is fairly simpleit' list of lists of values if the value is the same as the value in blankthen it is an empty space if the value is an integerthen it represents box that is the color that the integer indexes in the colors constant list that is is blue is green is redand is yellow in order to create blank boardlist replication is used to create the lists of blank values which represents column this is done on line one of these lists is created for each of the columns in the board (this is what the for loop on line doesthe isonboard(and isvalidposition(functions def isonboard(xy) return > and boardwidth and boardheight the isonboard(is simple function which checks that the xy coordinates that are passed represent valid values that exist on the board as long as both the xy coordinates are not less or greater than or equal to the boardwidth and boardheight constantsthen the function returns true def isvalidposition(boardpieceadjx= adjy= ) return true if the piece is within the board and not colliding for in range(templatewidth) for in range(templateheight) isaboveboard piece[' 'adjy if isaboveboard or shapes[piece['shape']][piece['rotation']][ ][ =blank continue the isvalidposition(function is given board data structure and piece data structureand returns true if all the boxes in the piece are both on the board and not overlapping any boxes on the board this is done by taking the piece' xy coordinates (which is really the coordinate of the upper right box on the boxes for the pieceand adding the coordinate inside the piece data structure here' couple pictures to help illustrate thisemail questions to the authoral@inventwithpython com