Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
def empty_state():
    return c4.getNewBoard()
def empty_state():
    return c4.getNewBoard()