Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def move(n,x,y):
- if n>0:
- if n==1 and y!=2:
- move(n-1,x,6-x-y)
- print(n,x,y)
- move(n-1,6-x-y,y)
- else:
- move(n-1,x,y)
- print(n,x,6-x-y)
- move(n-1,y,x)
- print(n,6-x-y,y)
- move(n-1,x,y)
- n=int(input())
- move(n,1,3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement