|
@@ -48,20 +48,20 @@ def erase_karel(karel):
|
|
|
Waiting for Stanford to fix a bug in the environment
|
|
Waiting for Stanford to fix a bug in the environment
|
|
|
CIP bug: https://codeinplace.stanford.edu/cip6/report?post=7043ece9-7653-4e39-8a63-5f4544b1d74b
|
|
CIP bug: https://codeinplace.stanford.edu/cip6/report?post=7043ece9-7653-4e39-8a63-5f4544b1d74b
|
|
|
|
|
|
|
|
-def move_karel(canvas, karel, dx, dy):
|
|
|
|
|
|
|
+def move_karel(canvas, karel, x, y):
|
|
|
for shape in karel[0].values():
|
|
for shape in karel[0].values():
|
|
|
- canvas.move(shape, dx, dy)
|
|
|
|
|
- logger.debug(f"Moved: {karel} by {dx} horizontally, {dy} vertically")
|
|
|
|
|
|
|
+ canvas.move(shape, x, y)
|
|
|
|
|
+ logger.debug(f"Moved: {karel} by {x} horizontally, {y} vertically")
|
|
|
"""
|
|
"""
|
|
|
-def move_karel(karel, dx:int=0, dy:int=0):
|
|
|
|
|
|
|
+def move_karel(karel, x:int=0, y:int=0):
|
|
|
# Update coordinates in list
|
|
# Update coordinates in list
|
|
|
- karel[1][1] += dx
|
|
|
|
|
- karel[1][2] += dy
|
|
|
|
|
|
|
+ karel[1][1] += x
|
|
|
|
|
+ karel[1][2] += y
|
|
|
|
|
|
|
|
erase_karel(karel)
|
|
erase_karel(karel)
|
|
|
new_karel = draw_karel(karel[1][0], karel[1][1], karel[1][2], karel[1][3], karel[1][4], karel[1][5], karel[1][6], karel[1][7])
|
|
new_karel = draw_karel(karel[1][0], karel[1][1], karel[1][2], karel[1][3], karel[1][4], karel[1][5], karel[1][6], karel[1][7])
|
|
|
|
|
|
|
|
- logger.debug(f"Moved: {karel} by {dx} horizontally, {dy} vertically, to {new_karel}")
|
|
|
|
|
|
|
+ logger.debug(f"Moved: {karel} by {x} horizontally, {y} vertically, to {new_karel}")
|
|
|
return new_karel
|
|
return new_karel
|
|
|
|
|
|
|
|
# Change the orientation of a passed Karel
|
|
# Change the orientation of a passed Karel
|