47 def step(self, direction):
48 old_head = self.snake[0]
49 movement = DIRECTIONS[direction]
50 new_head = old_head + movement 51
52 if (
53 new_head[0] < 0 or
46
47 def step(self, direction):
48 old_head = self.snake[0]
49 movement = DIRECTIONS[direction] 50 new_head = old_head + movement
51
52 if (
45 self.fruit = np.array([x, y])
46
47 def step(self, direction):
48 old_head = self.snake[0] 49 movement = DIRECTIONS[direction]
50 new_head = old_head + movement
51
44 break
45 self.fruit = np.array([x, y])
46
47 def step(self, direction): 48 old_head = self.snake[0]
49 movement = DIRECTIONS[direction]
50 new_head = old_head + movement
42 y = random.randint(0, SCREEN_SIZE-1)
43 if list([x, y]) not in self.snake.tolist():
44 break
45 self.fruit = np.array([x, y]) 46
47 def step(self, direction):
48 old_head = self.snake[0]
Statements use indentations that are not standard four spaces. PEP 8 recommends 4 spaces to be used as single indent.