topmargin windowheight (boardheight boxsize the program needs to calculate how many pixels are to the left and right side of the board to use later in the program windowwidth is the total number of pixels wide the entire window is the board is boardwidth boxes wide and each box is boxsize pixels wide if we subtract boxsize pixels from this for each of the boxes wide in the board (which is boardwidth boxsize)we'll have the size of the margin to the left and right of the board if we divide this by then we will have the size of just one margin since the margins are the same sizewe can use xmargin for either the left-side or right-side margin we can calculate the size of the space between the top of the board and the top of the window in similar manner the board will be drawn pixels above the bottom of the windowso is subtracted from topmargin to account for this white ( gray ( black red ( lightred ( green lightgreen blue lightblue yellow ( lightyellow (