for xy in getvalidmoves(dupeboardtile) dupeboard[ ][yhint_tile return dupeboard def getvalidmoves(boardtile) returns list of ( ,ytuples of all valid moves validmoves [ for in range(boardwidth) for in range(boardheight) if isvalidmove(boardtilexy!false validmoves append((xy) return validmoves def getscoreofboard(board) determine the score by counting the tiles xscore oscore for in range(boardwidth) for in range(boardheight) if board[ ][ =white_tile xscore + if board[ ][ =black_tile oscore + return {white_tile:xscoreblack_tile:oscore def enterplayertile() draws the text and handles the mouse click events for letting the player choose which color they want to be returns [white_tileblack_tileif the player chooses to be white [black_tilewhite_tileif black create the text textsurf font render('do you want to be white or black?'truetextcolortextbgcolor textrect textsurf get_rect( textrect center (int(windowwidth )int(windowheight ) xsurf bigfont render('white'truetextcolortextbgcolor xrect xsurf get_rect( xrect center (int(windowwidth int(windowheight osurf bigfont render('black'truetextcolortextbgcolor email questions to the authoral@inventwithpython com