Finished rolling stone playfield generation.
This commit is contained in:
@@ -53,13 +53,9 @@ class Left(Direction):
|
||||
x, y = pos
|
||||
return x - 1, y
|
||||
|
||||
succ = {Up: Right,
|
||||
Right: Down,
|
||||
Down: Left,
|
||||
Left: Up}.__getitem__
|
||||
all_directions = set((Up, Left, Down, Right))
|
||||
|
||||
pred = {Right: Up,
|
||||
Down: Right,
|
||||
Left: Down,
|
||||
Up: Left}.__getitem__
|
||||
succ = lambda d: all_directions[(all_directions.index(d) + 1) % 4]
|
||||
pred = lambda d: all_directions[(all_directions.index(d) - 1) % 4]
|
||||
|
||||
isDirection = lambda obj: obj in (Up, Left, Down, Right)
|
||||
|
||||
Reference in New Issue
Block a user