the grid if you play the game littleyou'll notice that the apple and the segments of the worm' body always fit along grid of lines we will call each of the squares in this grid cell (it' not always what space in grid is calledit' just name came up withthe cells have their own cartesian coordinate systemwith ( being the top left cell and ( being the bottom right cell the setup code wormy ( nibbles clone by al sweigart al@inventwithpython com creative commons by-nc-sa us import randompygamesys from pygame locals import fps windowwidth windowheight cellsize assert windowwidth cellsize = "window width must be multiple of cell size assert windowheight cellsize = "window height must be multiple of cell size cellwidth int(windowwidth cellsize cellheight int(windowheight cellsize