return any([all([(self board[ - =self nopponentfor in combination]for combination in possible_combinations]define check for the finish of game def is_over(self)return (self possible_moves(=[]or self condition_for_lose(show the current position of the players in the game def show(self)print('\ '+'\njoin([join([['' '' '][self board[ * ]for in range( )]for in range( )])compute the scores def scoring(self)return - if self condition_for_lose(else define the main method to define the algorithm and start the gameif __name__ ="__main__"algo negamax( tictactoe_game([human_player()ai_player(algo)]play(you can see the following output and simple play of this gameplayer what do you play move # player plays move # player plays