-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScrambleGen.py
146 lines (138 loc) · 4.79 KB
/
ScrambleGen.py
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# IMPORT NOTE: This generates scrambles of a given length and combines each of them with each
# colour OR combines each scramble with the specific colour white ("w").
# To write the files with the correct data, choose one of the uppermost blocks to generate the
# onemovers and name this field "onemovers". The other block shall be commented out.
# If you want to generate the one with every colour, choose the upper block, if you only need to
# generate the file with the colour white, choose the second one.
# Choose a suiting filename for each scramble-length by typing
# scambles[number of moves][w (for white) or write nothing here (for all colours)]
posschars = ["R", "R\'", "L", "L\'", "U", "U\'", "B", "B\'"]
posscols = ["w", "y", "g", "r", "b", "o"]
'''
# all eight onemovers combined with all colours
onemovers = []
for i in range(len(posschars)):
for j in range(len(posscols)):
kombi = [posschars[i], posscols[j]]
onemovers.append(kombi)
#print(onemovers)
scr1 = open('scrambles1.txt','w')
for i in range(len(onemovers)):
for j in range(0,2):
scr1.write(str(onemovers[i][j])+"\n")
scr1.close()
'''
# only with white or any other specific colour someone chose
onemovers = []
for i in range(len(posschars)):
kombi = [posschars[i], "w"]
onemovers.append(kombi)
#print(onemovers)
'''
scr1w = open('scrambles1w.txt','w')
for i in range(len(newonemovers)):
for j in range(0,2):
scr1w.write(str(newonemovers[i][j])+"\n")
scr1w.close()
'''
twomovers = []
for j in range(len(onemovers)):
for i in range(len(posschars)):
if onemovers[j][0] in posschars[i]:
continue
elif posschars[i] in onemovers[j][0]:
continue
else:
kombi2 = [onemovers[j][0]+" "+posschars[i], onemovers[j][1]]
twomovers.append(kombi2)
#print(twomovers)
scr2 = open('scrambles2w.txt','w')
for i in range(len(twomovers)):
for j in range(0,2):
scr2.write(str(twomovers[i][j])+"\n")
scr2.close()
threemovers = []
for j in range(len(twomovers)):
for i in range(len(posschars)):
if twomovers[j][0][-2] == " ":
if twomovers[j][0][-1] == posschars[i][0]:
continue
else:
if twomovers[j][0][-2] == posschars[i][0]:
continue
kombi3 = [twomovers[j][0]+" "+posschars[i], twomovers[j][1]]
threemovers.append(kombi3)
# print(threemovers)
scr3 = open('scrambles3w.txt','w')
for i in range(len(threemovers)):
for j in range(0,2):
scr3.write(str(threemovers[i][j])+"\n")
scr3.close()
fourmovers = []
for j in range(len(threemovers)):
for i in range(len(posschars)):
if threemovers[j][0][-2] == " ":
if threemovers[j][0][-1] == posschars[i][0]:
continue
else:
if threemovers[j][0][-2] == posschars[i][0]:
continue
kombi4 = [threemovers[j][0]+" "+posschars[i], threemovers[j][1]]
fourmovers.append(kombi4)
#print(fourmovers)
scr4 = open('scrambles4w.txt','w')
for i in range(len(fourmovers)):
for j in range(0,2):
scr4.write(str(fourmovers[i][j])+"\n")
scr4.close()
fivemovers = []
for j in range(len(fourmovers)):
for i in range(len(posschars)):
if fourmovers[j][0][-2] == " ":
if fourmovers[j][0][-1] == posschars[i][0]:
continue
else:
if fourmovers[j][0][-2] == posschars[i][0]:
continue
kombi5 = [fourmovers[j][0]+" "+posschars[i], fourmovers[j][1]]
fivemovers.append(kombi5)
#print(fivemovers)
scr5 = open('scrambles5w.txt','w')
for i in range(len(fivemovers)):
for j in range(0,2):
scr5.write(str(fivemovers[i][j])+"\n")
scr5.close()
sixmovers = []
for j in range(len(fivemovers)):
for i in range(len(posschars)):
if fivemovers[j][0][-2] == " ":
if fivemovers[j][0][-1] == posschars[i][0]:
continue
else:
if fivemovers[j][0][-2] == posschars[i][0]:
continue
kombi6 = [fivemovers[j][0]+" "+posschars[i], fivemovers[j][1]]
sixmovers.append(kombi6)
#print(sixmovers)
scr6 = open('scrambles6w.txt','w')
for i in range(len(sixmovers)):
for j in range(0,2):
scr6.write(str(sixmovers[i][j])+"\n")
scr6.close()
sevenmovers = []
for j in range(len(sixmovers)):
for i in range(len(posschars)):
if sixmovers[j][0][-2] == " ":
if sixmovers[j][0][-1] == posschars[i][0]:
continue
else:
if sixmovers[j][0][-2] == posschars[i][0]:
continue
kombi7 = [sixmovers[j][0]+" "+posschars[i], sixmovers[j][1]]
sevenmovers.append(kombi7)
#print(sevenmovers)
scr7 = open('scrambles7w.txt','w')
for i in range(len(sevenmovers)):
for j in range(0,2):
scr7.write(str(sevenmovers[i][j])+"\n")
scr7.close()