showhelp false set up blank board data structure mainboard getnewboard( while truemain game loop if turn =human human player' turn gethumanmove(mainboardshowhelp if showhelp turn off help arrow after the first move showhelp false if iswinner(mainboardred) winnerimg humanwinnerimg break turn computer switch to other player' turn else computer player' turn column getcomputermove(mainboard animatecomputermoving(mainboardcolumn makemove(mainboardblackcolumn if iswinner(mainboardblack) winnerimg computerwinnerimg break turn human switch to other player' turn if isboardfull(mainboard) completely filled board means it' tie winnerimg tiewinnerimg break while true keep looping until player clicks the mouse or quits drawboard(mainboard displaysurf blit(winnerimgwinnerrect pygame display update( fpsclock tick( for event in pygame event get()event handling loop if event type =quit or (event type =keyup and event key =k_escape) pygame quit( sys exit( elif event type =mousebuttonup return email questions to the authoral@inventwithpython com