需要关于此作业的帮助?欢迎联系我

C4Agent

For this question you should build a minimax agent for connect four. You have been given a python skeleton and should write a classwith a single method, move. This method is given: a symbol ('X' or 'O' indicating which discs are the players), a board (a list of 7 strings, each string representing a column of the game with the frst character being the bottom row, made upof the characters 'X' and '0'. Note that the strings are initially empty and grow throughout the game to a maximum length of 6. your opponents last move (the index of a column they dropped the disc into, or -1 if it is the first move).The method returns the index of the column your strategy chooses to put the disc into. Note if your method returns a column outsidethe range [0-61 or tries to put a disc into a full column, it automatically loses.The first test method will pitch your agent against a random opponent four times, and your agent needs to win al games to pass. At theend of the game you are given a string representation of the board. Your discs are labelled 'A'. 'B' 'C'... and the opponents are'a b' 'c'.... so you can infer the order they were played. The second test requires your agent to beat a simple 2 ply minimax agent

class C4Agent:
def move(self,symbol,board,last_move):
  """
  symbol is the character that represents the agents moves in the boardsymbol will be consistent throughout the gameboard is an array of 7 strings each describing a column of the boardlast_ move is the column that the opponent last droped a piece into (or -1 if it is tlThis method should return the column the agent would like to drop their token into.
  """
  #insertcode here