Advertisement
achulkov2

Untitled

Feb 26th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. def move(n,x,y):
  2. if n>0:
  3. if n==1 and y!=2:
  4. move(n-1,x,6-x-y)
  5. print(n,x,y)
  6. move(n-1,6-x-y,y)
  7. else:
  8. move(n-1,x,y)
  9. print(n,x,6-x-y)
  10. move(n-1,y,x)
  11. print(n,6-x-y,y)
  12. move(n-1,x,y)
  13.  
  14. n=int(input())
  15. move(n,1,3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement