forked from matiyau/RuDe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcubeSlv_HeurFile.py
More file actions
executable file
·43 lines (32 loc) · 1020 Bytes
/
cubeSlv_HeurFile.py
File metadata and controls
executable file
·43 lines (32 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from math import factorial as fact
#from threading import Thread
#import pickle
#import time
#th=[Thread for i in range (0,56)]
def steps():
#List of heuristic functions for each and every cube orientation and permutation
with open('PatternDB', 'wb') as pattern:
for c in range(0,fact(7)):
for b in range (0,(3**6)/2):
pattern.write(chr(236))
pattern.write(chr(224))
pattern.write('\n')
#print ' Done', i
print 'Start'
'''
heur=[[[[[[[[chr(11) for g in range (0, 3)] for f in range (0,3)] for e in range (0,3)] for d in range (0,3)] for c in range (0,3)] for b in range (0,3)] for a in range (0,3)] for i in range (0,40320)]
print time.time()
with open ('DBPat', 'wb') as pattern:
pickle.dump(heur, pattern)
for a in range(0,56):
try:
th[i]=Thread(target=steps, args=(a,))
th[i].start()
except:
print "Error in", j
for a in range(0,56):
th[i].join()
'''
steps()
#print time.time()
print 'End'