Fixed a few bugs and added laser mirror room generator.

This commit is contained in:
Niels Serup
2012-08-08 18:37:09 +02:00
parent 20e06e572e
commit 7666891baa
6 changed files with 157 additions and 12 deletions

View File

@@ -53,9 +53,7 @@ class Left(Direction):
x, y = pos
return x - 1, y
all_directions = set((Up, Left, Down, Right))
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)
all_directions = (Up, Right, Down, Left)
_sp = lambda n: lambda d: all_directions[(all_directions.index(d) + n) % 4]
succ, pred = _sp(1), _sp(-1)
isDirection = all_directions.__contains__