def makemove(boardplayercolumn) lowest getlowestemptyspace(boardcolumn if lowest !- board[column][lowestplayer def drawboard(boardextratoken=none) displaysurf fill(bgcolor draw tokens spacerect pygame rect( spacesizespacesize for in range(boardwidth) for in range(boardheight) spacerect topleft (xmargin ( spacesize)ymargin ( spacesize) if board[ ][ =red displaysurf blit(redtokenimgspacerect elif board[ ][ =black displaysurf blit(blacktokenimgspacerect draw the extra token if extratoken !none if extratoken['color'=red displaysurf blit(redtokenimg(extratoken[' ']extratoken[' ']spacesizespacesize) elif extratoken['color'=black displaysurf blit(blacktokenimg(extratoken[' ']extratoken[' ']spacesizespacesize) draw board over the tokens for in range(boardwidth) for in range(boardheight) spacerect topleft (xmargin ( spacesize)ymargin ( spacesize) displaysurf blit(boardimgspacerect draw the red and black tokens off to the side displaysurf blit(redtokenimgredpilerectred on the left displaysurf blit(blacktokenimgblackpilerectblack on the right def getnewboard() board [ for in range(boardwidth) board append([emptyboardheight return board