コード例 #1
0
ファイル: PlayerAI.py プロジェクト: arkadyark/tron
 def get_move(self, game_map, player_lightcycle, opponent_lightcycle,
              moveNumber):
     startTime = time.time()
     next_move = alphabeta(
         (game_map, player_lightcycle, opponent_lightcycle),
         ALPHA_BETA_DEPTH, self.heuristic)
     print "Took " + str(time.time() -
                         startTime) + "s to calculate next move!"
     print(next_move)
     return next_move
コード例 #2
0
def main():
	print("hey this is alphabeta chess enter the moves in the from of 1234b ")
	ab=alphabeta(4, 1000000, -1000000,"", 0)
	ab.show()
	s=input("enter the move ")
#	ab=alphabeta(4, 1000000, -1000000,"", 0)
	ab.letzdoit(s)
	s=input("enter the move ")
#	ab=alphabeta(4, 1000000, -1000000,"", 0)
	ab.letzdoit(s)
	s=input("enter the move ")
#	ab=alphabeta(4, 1000000, -1000000,"", 0)
	ab.letzdoit(s)
コード例 #3
0
    def get_move(self, game_map, player_lightcycle, opponent_lightcycle, moveNumber):
        startTime = time.time()
        next_move = alphabeta((game_map, player_lightcycle, opponent_lightcycle), 5, self.heuristic)

        print "Took " + str(time.time() - startTime) + "ms to calculate next move!"
        return next_move
コード例 #4
0
 def get_move(self, game_map, player_lightcycle, opponent_lightcycle, moveNumber):
     startTime = time.time()
     next_move = alphabeta((game_map, player_lightcycle, opponent_lightcycle), 5, self.heuristic)