Removed ugly spaces.
This commit is contained in:
parent
75f287c048
commit
f353d27d8c
|
@ -50,7 +50,7 @@ class Turn(Field):
|
||||||
class Goal(Field):
|
class Goal(Field):
|
||||||
def next_posdir(self, pos, direc):
|
def next_posdir(self, pos, direc):
|
||||||
return pos, direc
|
return pos, direc
|
||||||
|
|
||||||
class Stone(Field):
|
class Stone(Field):
|
||||||
def next_posdir(self, pos, direc):
|
def next_posdir(self, pos, direc):
|
||||||
return pos, direc
|
return pos, direc
|
||||||
|
@ -61,7 +61,7 @@ def step(playfield, pos, direc):
|
||||||
if field is not None:
|
if field is not None:
|
||||||
return field.next_posdir(pos, direc)
|
return field.next_posdir(pos, direc)
|
||||||
return direc.next_pos(pos), direc
|
return direc.next_pos(pos), direc
|
||||||
|
|
||||||
def reaches_goal(playfield, max_steps):
|
def reaches_goal(playfield, max_steps):
|
||||||
pos = _find_start(playfield)
|
pos = _find_start(playfield)
|
||||||
direc = None
|
direc = None
|
||||||
|
@ -87,3 +87,7 @@ def _at(playfield, pos):
|
||||||
_is = lambda t: lambda playfield, pos: isinstance(_at(playfield, pos), t)
|
_is = lambda t: lambda playfield, pos: isinstance(_at(playfield, pos), t)
|
||||||
|
|
||||||
(isGoal, isTurn, isStart, isStone) = (_is(Goal), _is(Turn), _is(Start), _is(Stone))
|
(isGoal, isTurn, isStart, isStone) = (_is(Goal), _is(Turn), _is(Start), _is(Stone))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def generate_playfield():
|
||||||
|
|
Loading…
Reference in New Issue