Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
darius committed Jun 5, 2014
1 parent 9af0618 commit 46f8043
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sturm/2048.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def left(board):
states = tuple(sliding(lo, row) for lo,row in states)

def sliding(lo, row):
"""Slide row one place leftward, leaving fixed any places left of lo.
Advance lo past merging or completion."""
for i in range(lo+1, 4):
if (row[i-1] == 0) != (row[i-1] == row[i]):
if row[i-1] == row[i]: lo = i
Expand Down

0 comments on commit 46f8043

Please sign in to comment.