Brainiac11 / My-Projects

Indentation is not a multiple of four FLK-E111
Style
Major
a year agoa year old
indentation is not a multiple of 4
 17class Snake():
 18  snake, fruit = None, None
 19
 20  def __init__(self, s, genome): 21    self.genome = genome
 22
 23    self.s = s
indentation is not a multiple of 4
 32    self.fitness = 0.
 33    self.last_dist = np.inf
 34
 35  def place_fruit(self, coord=None): 36    if coord:
 37      self.fruit = np.array(coord)
 38      return
indentation is not a multiple of 4
 34
 35  def place_fruit(self, coord=None):
 36    if coord:
 37      self.fruit = np.array(coord) 38      return
 39
 40    while True:
indentation is not a multiple of 4
 35  def place_fruit(self, coord=None):
 36    if coord:
 37      self.fruit = np.array(coord)
 38      return 39
 40    while True:
 41      x = random.randint(0, SCREEN_SIZE-1)
indentation is not a multiple of 4
 38      return
 39
 40    while True:
 41      x = random.randint(0, SCREEN_SIZE-1) 42      y = random.randint(0, SCREEN_SIZE-1)
 43      if list([x, y]) not in self.snake.tolist():
 44        break