forked from quentin/quentin.dufour.io
FIx code
This commit is contained in:
parent
04c5ff0c6b
commit
a3e49dcd28
1 changed files with 4 additions and 4 deletions
|
@ -310,13 +310,13 @@ def convert_path_to_relative_moves(p):
|
||||||
dx = p[0][0] - p[1][0]
|
dx = p[0][0] - p[1][0]
|
||||||
dy = p[0][1] - p[1][1]
|
dy = p[0][1] - p[1][1]
|
||||||
if dx < 0: # right
|
if dx < 0: # right
|
||||||
return 'l'+recompute_path(p[1:])
|
return 'l'+convert_path_to_relative_moves(p[1:])
|
||||||
elif dx > 0: # left
|
elif dx > 0: # left
|
||||||
return 'j'+recompute_path(p[1:])
|
return 'j'+convert_path_to_relative_moves(p[1:])
|
||||||
elif dy < 0: # bottom
|
elif dy < 0: # bottom
|
||||||
return 'k'+recompute_path(p[1:])
|
return 'k'+convert_path_to_relative_moves(p[1:])
|
||||||
elif dy > 0: # up
|
elif dy > 0: # up
|
||||||
return 'i'+recompute_path(p[1:])
|
return 'i'+convert_path_to_relative_moves(p[1:])
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
# get input
|
# get input
|
||||||
|
|
Loading…
Reference in a new issue