Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def finder(p1,p2, cnt):
- G.append(p1)
- if p1 == p2:
- return cnt
- print(p1,poss(p1,p2))
- if cnt > 3:
- return 0
- if p2 in poss(p1,p2):
- print("blah",cnt)
- return cnt
- else:
- for i in poss(p1,p2):
- if i not in G:
- result = finder(p1,p2,cnt+1)
- if result is not None:
- return result
- ^ What I did
- Output:
- [6, 1]
- [1, 1] [[3, 2], [2, 3]]
- [1, 1] [[3, 2], [2, 3]]
- [1, 1] [[3, 2], [2, 3]]
- [1, 1] [[3, 2], [2, 3]]
- 0
- Clearly it didn't explored much, but before the addition I was getting something like:
- [1, 1] [[3, 2], [2, 3]]
- [3, 2] [[5, 1], [5, 3], [4, 4], [2, 4], [1, 1], [1, 3]]
- [5, 1] [[7, 2], [6, 3], [4, 3], [3, 2]]
- [7, 2] [[5, 1], [5, 3], [6, 4], [8, 4]]
- [6, 3] [[7, 1], [5, 1], [8, 2], [4, 2], [8, 4], [4, 4], [7, 5], [5, 5]]
- [4, 3] [[5, 1], [6, 2], [3, 1], [6, 4], [5, 5], [2, 2], [3, 5], [2, 4]]
- [5, 3] [[6, 1], [7, 2], [4, 1], [7, 4], [3, 2], [6, 5], [3, 4], [4, 5]]
- blah 3
- [4, 4] [[5, 2], [6, 3], [3, 2], [6, 5], [2, 3], [5, 6], [2, 5], [3, 6]]
- [5, 2] [[7, 1], [7, 3], [6, 4], [3, 1], [4, 4], [3, 3]]
- [6, 5] [[7, 3], [5, 3], [8, 4], [4, 4], [8, 6], [4, 6], [7, 7], [5, 7]]
- [2, 3] [[4, 2], [3, 1], [4, 4], [3, 5], [1, 1], [1, 5]]
- [5, 6] [[6, 4], [4, 4], [7, 5], [3, 5], [7, 7], [3, 7], [6, 8], [4, 8]]
- [2, 5] [[3, 3], [4, 4], [1, 3], [4, 6], [3, 7], [1, 7]]
- [3, 6] [[4, 4], [5, 5], [2, 4], [5, 7], [1, 5], [4, 8], [1, 7], [2, 8]]
- [2, 4] [[4, 3], [3, 2], [4, 5], [1, 2], [3, 6], [1, 6]]
- [4, 5] [[5, 3], [6, 4], [3, 3], [6, 6], [2, 4], [5, 7], [2, 6], [3, 7]]
- [1, 2] [[3, 1], [3, 3], [2, 4]]
- [1, 6] [[2, 4], [3, 5], [3, 7], [2, 8]]
- [1, 3] [[3, 2], [2, 1], [3, 4], [2, 5]]
- [2, 1] [[4, 2], [3, 3], [1, 3]]
- [3, 4] [[4, 2], [5, 3], [2, 2], [5, 5], [4, 6], [1, 3], [2, 6], [1, 5]]
- I just want to stop when blah 3 was printed.
Add Comment
Please, Sign In to add comment