return float(self.value[piece.types[0]] + self.value[piece.types[1]]) / 2.0
# Score possible moves for the piece
- # Highest score is 1.0 (which means: make this move!)
+
def prioritise_moves(self, piece):
#sys.stderr.write(sys.argv[0] + ": prioritise called for " + str(piece) + "\n")
if self.recurse_for >= 0:
opts = opts[0:self.recurse_for]
- sys.stderr.write(sys.argv[0] + " : Before recurse, options are " + str(opts) + "\n")
+ #sys.stderr.write(sys.argv[0] + " : Before recurse, options are " + str(opts) + "\n")
# Take the best few moves, and recurse
for choice in opts[0:self.recurse_for]:
opts.sort(key = lambda e : e[1][1], reverse = True)
- sys.stderr.write(sys.argv[0] + " : After recurse, options are " + str(opts) + "\n")
+ #sys.stderr.write(sys.argv[0] + " : After recurse, options are " + str(opts) + "\n")
self.depth -= 1
return list(opts[0])
agent = Agent(argv[0], colour) # Creates your agent
- graphics = AgentGraphics(agent.board, title="Agent Bishop (" + str(colour) + ") - DEBUG VIEW")
- graphics.start()
+ #graphics = AgentGraphics(agent.board, title="Agent Bishop (" + str(colour) + ") - DEBUG VIEW")
+ #graphics.start()
# Plays quantum chess using your agent
while True:
else:
agent.update(line) # Updates agent.board
- graphics.stop()
- graphics.join()
+ #graphics.stop()
+ #graphics.join()
return 0
# Don't touch this