+++ /dev/null
-
-if __name__ == '__main__':
- frontier = [(0, [], range(1, 8))]
- oldlen = 0
- iterations = 0
-
- while frontier:
- it, moves, a = frontier.pop(0)
- iterations += 1
-
- if len(moves) > oldlen:
- oldlen = len(moves)
- print oldlen
- h50 = [x for x in a if x > 50 and a.count(x) > 1]
- if h50:
- break
- for i in range(1, len(a)-1):
- aa = a[:]
- aa[i] = a[i-1]+a[i+1]
- moves2 = moves[:]
- frontier.append((it+1, moves2 + [i], aa))
-
- print it, iterations, moves, a