X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=qchess%2Fsrc%2Fagent_bishop.py;fp=qchess%2Fsrc%2Fagent_bishop.py;h=14640195f6d5f2aabe0467f4afd3876e1159e715;hb=3decbfd61b59ee2611700e7fa96368e02f643d4d;hp=13be5bdcb2fdb79a95746fce220e3be70d365992;hpb=a238aa7acac990bae67644d1dc7f518ce3e2e8c6;p=progcomp2013.git diff --git a/qchess/src/agent_bishop.py b/qchess/src/agent_bishop.py index 13be5bd..1464019 100644 --- a/qchess/src/agent_bishop.py +++ b/qchess/src/agent_bishop.py @@ -1,7 +1,7 @@ # A sample agent -class AgentBishop(InternalAgent): # Inherits from InternalAgent (in qchess) +class AgentBishop(AgentRandom): # Inherits from AgentRandom (in qchess) def __init__(self, name, colour): InternalAgent.__init__(self, name, colour) self.value = {"pawn" : 1, "bishop" : 3, "knight" : 3, "rook" : 5, "queen" : 9, "king" : 100, "unknown" : 4} @@ -163,6 +163,7 @@ class AgentBishop(InternalAgent): # Inherits from InternalAgent (in qchess) def select(self): #sys.stderr.write("Getting choice...") self.choice = self.select_best(self.colour)[0] + #sys.stderr.write(" Done " + str(self.choice)+"\n") return [self.choice.x, self.choice.y] @@ -174,5 +175,5 @@ class AgentBishop(InternalAgent): # Inherits from InternalAgent (in qchess) if len(moves) > 0: return moves[0][0] else: - return InternalAgent.get_move(self) + return AgentRandom.get_move(self)