pygame display set_caption('four in row' redpilerect pygame rect(int(spacesize )windowheight int( spacesize )spacesizespacesize blackpilerect pygame rect(windowwidth int( spacesize )windowheight int( spacesize )spacesizespacesize redtokenimg pygame image load(' row_red png' redtokenimg pygame transform smoothscale(redtokenimg(spacesizespacesize) blacktokenimg pygame image load(' row_black png' blacktokenimg pygame transform smoothscale(blacktokenimg(spacesizespacesize) boardimg pygame image load(' row_board png' boardimg pygame transform smoothscale(boardimg(spacesizespacesize) humanwinnerimg pygame image load(' row_humanwinner png' computerwinnerimg pygame image load(' row_computerwinner png' tiewinnerimg pygame image load(' row_tie png' winnerrect humanwinnerimg get_rect( winnerrect center (int(windowwidth )int(windowheight ) arrowimg pygame image load(' row_arrow png' arrowrect arrowimg get_rect( arrowrect left redpilerect right arrowrect centery redpilerect centery isfirstgame true while true rungame(isfirstgame isfirstgame false def rungame(isfirstgame) if isfirstgame let the computer go first on the first gameso the player can see how the tokens are dragged from the token piles turn computer showhelp true else randomly choose who goes first if random randint( = turn computer else turn human