def animatedroppingtoken(boardcolumncolor) xmargin column spacesize ymargin spacesize dropspeed lowestemptyspace getlowestemptyspace(boardcolumn while true +int(dropspeed dropspeed + if int(( ymarginspacesize>lowestemptyspace return drawboard(board{' ': ' ': 'color':color} pygame display update( fpsclock tick( def animatecomputermoving(boardcolumn) blackpilerect left blackpilerect top speed moving the black tile up while (ymargin spacesize) -int(speed speed + drawboard(board{' ': ' ': 'color':black} pygame display update( fpsclock tick( moving the black tile over ymargin spacesize speed while (xmargin column spacesize) -int(speed speed + drawboard(board{' ': ' ': 'color':black} pygame display update( fpsclock tick( dropping the black tile animatedroppingtoken(boardcolumnblack def getcomputermove(board) potentialmoves getpotentialmoves(boardblackdifficulty get the best fitness from the potential moves bestmovefitness -