diff --git a/robotgame/logic/rollingstone.py b/robotgame/logic/rollingstone.py index 487a048..8975678 100644 --- a/robotgame/logic/rollingstone.py +++ b/robotgame/logic/rollingstone.py @@ -50,7 +50,7 @@ class Turn(Field): class Goal(Field): def next_posdir(self, pos, direc): return pos, direc - + class Stone(Field): def next_posdir(self, pos, direc): return pos, direc @@ -61,7 +61,7 @@ def step(playfield, pos, direc): if field is not None: return field.next_posdir(pos, direc) return direc.next_pos(pos), direc - + def reaches_goal(playfield, max_steps): pos = _find_start(playfield) direc = None @@ -87,3 +87,7 @@ def _at(playfield, pos): _is = lambda t: lambda playfield, pos: isinstance(_at(playfield, pos), t) (isGoal, isTurn, isStart, isStone) = (_is(Goal), _is(Turn), _is(Start), _is(Stone)) + + + +def generate_playfield():