def play(self): state = c4.getNewBoard() player = 1 while not c4.isBoardFull(state): if player == 1: move = self.action(state, player) else: move = c4.getRandomMove(state) state = c4.makeMove(state, player, move) if c4.isWinner(state, player): return player player *= -1 return 0.5 # draw
def play(self): state = c4.getNewBoard() player = 1 while not c4.isBoardFull(state): if player == 1: move = self.action(state, player) else: move = c4.getRandomMove(state) state = c4.makeMove(state, player, move) if c4.isWinner(state, player): return player player *= -1 return 0.5 # draw
def empty_state(): return c4.getNewBoard()
def empty_state(): return c4.getNewBoard()