diff --git a/AI.py b/AI.py index 7038975..3208bf6 100644 --- a/AI.py +++ b/AI.py @@ -1,9 +1,17 @@ +from random import Random + + class AI: def pick(self, world): + self.r = Random() print("pick") world.choose_deck([1, 2, 3, 4]) - print(world.get_shortest_path_to_cell(player_id=world.get_my_id(), row=10, col=10)) + print(world.put_unit(type_id=1, path=world.map.paths[self.r.randint(1, 4)])) + if len(world.player.units) > 0: + print(world.player.units[0].cell) def turn(self, world): print("turn") + if len(world.player.units) > 0: + print(world.player.units[0].cell) diff --git a/world.py b/world.py index 2dd0554..c30fab1 100644 --- a/world.py +++ b/world.py @@ -377,8 +377,6 @@ def get_shortest_path_to_cell(self, player_id, cell=None, row=None, col=None): cell = self.map.get_cell(row, col) shortest_path_to_cell = self.shortest_path.get(player_id) - print(shortest_path_to_cell) - if shortest_path_to_cell[cell.row][cell.col] == -1: return None