Skip to content

Commit

Permalink
Simplify simplify with enumerate()
Browse files Browse the repository at this point in the history
A more mild optimization
  • Loading branch information
cclauss committed Jul 7, 2016
1 parent b7bdf8b commit 26ebf2f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions player.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ def render_move(self):
def render_game_over(self):
render = []
# dead snake
for i in range(0, len(self.snake)):
pos = self.snake[i]
for i, pos in enumerate(self.snake):
if i == 0:
render.append(Draw(pos.x, pos.y, self.DEAD_HEAD_CHAR, 0))
elif i == len(self.snake) - 1:
Expand Down

0 comments on commit 26ebf2f

Please sign in to comment.