fix AI bug
This commit is contained in:
1 parent
7f6a01e2fb
commit
335836b03e
1 file changed
+3
-1
+3
-1
@@ -60,7 +60,9 @@ class AIPlayer(Player):
|
||||
def guess(self, opponent: Player) -> Coordinate:
|
||||
for guess in self.guesses:
|
||||
if self.coord_status(guess, opponent) == CoordStatus.HIT:
|
||||
return self.guess_near(guess, opponent)
|
||||
candidate = self.guess_near(guess, opponent)
|
||||
if candidate:
|
||||
return candidate
|
||||
|
||||
while True:
|
||||
guess = random.choice(opponent.board.columns), random.choice(opponent.board.rows)
|
||||
|
||||
Reference in new issue
Block a user