remove prints and add a note that i neat to fix later
This commit is contained in:
@@ -193,7 +193,6 @@ class BetterMasterSnake(TemplateSnake):
|
||||
future_position = safe_positions[move]
|
||||
except KeyError:
|
||||
for move, pos in safe_positions.items():
|
||||
print(move, pos, (self.my_body[-1]['x'], self.my_body[-1]['y']), self.is_near_tail((pos["x"], pos["y"]), (self.my_body[-1]['x'], self.my_body[-1]['y'])))
|
||||
if self.is_near_tail((pos["x"], pos["y"]), (self.my_body[-1]['x'], self.my_body[-1]['y'])):
|
||||
self.add_calculations({"function": "ensure_escape_route", "move": move, "is_near_tail": True})
|
||||
move = self.move_towards(pos, safe_positions)
|
||||
@@ -206,12 +205,12 @@ class BetterMasterSnake(TemplateSnake):
|
||||
|
||||
self.add_calculations({"function": "ensure_escape_route", "move": move, "KeyError": "Snake Coild itself up"})
|
||||
return move
|
||||
return move
|
||||
|
||||
future_coords = (future_position['x'], future_position['y'])
|
||||
tail_position = (self.my_body[-1]['x'], self.my_body[-1]['y'])
|
||||
|
||||
accessible_area_count = self.flood_fill_count(future_coords, [(part['x'], part['y']) for part in self.my_body])
|
||||
|
||||
self.add_calculations({
|
||||
"function": "ensure_escape_route",
|
||||
"move": move,
|
||||
@@ -219,7 +218,7 @@ class BetterMasterSnake(TemplateSnake):
|
||||
"accessible_area_count": accessible_area_count,
|
||||
})
|
||||
|
||||
print(accessible_area_count)
|
||||
# TODO: Fix - Snake Neat to find the best way - Close to the Tail and maybe fill most free cells as posible
|
||||
#if accessible_area_count < self.min_safe_area:
|
||||
# # Finde den nächstgelegenen Zug zum Schwanz
|
||||
# closest_move = min(safe_positions.keys(), key=lambda m: self.distance_to_tail(safe_positions[m], tail_position))
|
||||
|
||||
Reference in New Issue
Block a user