draw the horizontal lines startx ( spacesizexmargin starty ymargin endx ( spacesizexmargin endy ymargin (boardheight spacesize pygame draw line(displaysurfgridlinecolor(startxstarty)(endxendy) for in range(boardheight ) draw the vertical lines startx xmargin starty ( spacesizeymargin endx xmargin (boardwidth spacesize endy ( spacesizeymargin pygame draw line(displaysurfgridlinecolor(startxstarty)(endxendy) draw the black white tiles or hint spots for in range(boardwidth) for in range(boardheight) centerxcentery translateboardtopixelcoord(xy if board[ ][ =white_tile or board[ ][ =black_tile if board[ ][ =white_tile tilecolor white else tilecolor black pygame draw circle(displaysurftilecolor(centerxcentery)int(spacesize if board[ ][ =hint_tile pygame draw rect(displaysurfhintcolor(centerx centery ) def getspaceclicked(mousexmousey) return tuple of two integers of the board space coordinates where the mouse was clicked (or returns none not in any space for in range(boardwidth) for in range(boardheight) if mousex spacesize xmargin and mousex ( spacesize xmargin and mousey spacesize ymargin and mousey ( spacesize ymargin return (xy return none def drawinfo(boardplayertilecomputertileturn)