add history to existing snakes
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
from snakes.TemplateSnake import TemplateSnake
|
||||
|
||||
import random
|
||||
from scipy import spatial
|
||||
|
||||
class LogicSnake:
|
||||
class LogicSnake(TemplateSnake):
|
||||
def avoid_my_body(self, my_body, possible_moves: dict) -> list:
|
||||
"""
|
||||
my_body: List of dictionaries of x/y coordinates for every segment of a Battlesnake.
|
||||
@@ -138,6 +140,7 @@ class LogicSnake:
|
||||
move = "up"
|
||||
print("GOING TO LOSE!!")
|
||||
|
||||
self.add_to_history({"my_head": my_head, "my_body": tuple(my_body), "target": target, "possible_moves": possible_moves, "move": move})
|
||||
print(f"{data['game']['id']} MOVE {data['turn']}: {move} picked from all valid options in {possible_moves}")
|
||||
|
||||
return move
|
||||
|
||||
Reference in New Issue
Block a user