1
+ import cube
2
+
3
+ def R ():
4
+ cube .red = cube .red [::- 1 ]
5
+ cube .red = cube .red .transpose ()
6
+
7
+ tempg = [cube .green [0 ][2 ],cube .green [1 ][2 ],cube .green [2 ][2 ]]
8
+ tempw = [cube .white [0 ][2 ],cube .white [1 ][2 ],cube .white [2 ][2 ]]
9
+ tempb = [cube .blue [2 ][0 ],cube .blue [1 ][0 ],cube .blue [0 ][0 ]]
10
+ tempy = [cube .yellow [0 ][2 ],cube .yellow [1 ][2 ],cube .yellow [2 ][2 ]]
11
+
12
+ tempw ,tempb ,tempy ,tempg = tempg ,tempw ,tempb ,tempy
13
+
14
+ cube .green [0 ][2 ],cube .green [1 ][2 ],cube .green [2 ][2 ] = tempg [0 ],tempg [1 ],tempg [2 ]
15
+ cube .white [0 ][2 ],cube .white [1 ][2 ],cube .white [2 ][2 ] = tempw [0 ],tempw [1 ],tempw [2 ]
16
+ cube .blue [2 ][0 ],cube .blue [1 ][0 ],cube .blue [0 ][0 ] = tempb [0 ],tempb [1 ],tempb [2 ]
17
+ cube .yellow [0 ][2 ],cube .yellow [1 ][2 ],cube .yellow [2 ][2 ] = tempy [0 ],tempy [1 ],tempy [2 ]
18
+
19
+ def L ():
20
+ cube .orange = cube .orange [::- 1 ]
21
+ cube .orange = cube .orange .transpose ()
22
+
23
+ tempg = [cube .green [0 ][0 ],cube .green [1 ][0 ],cube .green [2 ][0 ]]
24
+ tempw = [cube .white [0 ][0 ],cube .white [1 ][0 ],cube .white [2 ][0 ]]
25
+ tempb = [cube .blue [2 ][2 ],cube .blue [1 ][2 ],cube .blue [0 ][2 ]]
26
+ tempy = [cube .yellow [0 ][0 ],cube .yellow [1 ][0 ],cube .yellow [2 ][0 ]]
27
+
28
+ tempw ,tempb ,tempy ,tempg = tempb ,tempy ,tempg ,tempw
29
+
30
+ cube .green [0 ][0 ],cube .green [1 ][0 ],cube .green [2 ][0 ] = tempg [0 ],tempg [1 ],tempg [2 ]
31
+ cube .white [0 ][0 ],cube .white [1 ][0 ],cube .white [2 ][0 ] = tempw [0 ],tempw [1 ],tempw [2 ]
32
+ cube .blue [2 ][2 ],cube .blue [1 ][2 ],cube .blue [0 ][2 ] = tempb [0 ],tempb [1 ],tempb [2 ]
33
+ cube .yellow [0 ][0 ],cube .yellow [1 ][0 ],cube .yellow [2 ][0 ] = tempy [0 ],tempy [1 ],tempy [2 ]
34
+
35
+ def U ():
36
+ cube .white = cube .white [::- 1 ]
37
+ cube .white = cube .white .transpose ()
38
+
39
+ tempg = [cube .green [0 ][0 ],cube .green [0 ][1 ],cube .green [0 ][2 ]]
40
+ tempo = [cube .orange [0 ][0 ],cube .orange [0 ][1 ],cube .orange [0 ][2 ]]
41
+ tempb = [cube .blue [0 ][0 ],cube .blue [0 ][1 ],cube .blue [0 ][2 ]]
42
+ tempr = [cube .red [0 ][0 ],cube .red [0 ][1 ],cube .red [0 ][2 ]]
43
+
44
+ tempg ,tempo ,tempb ,tempr = tempr ,tempg ,tempo ,tempb
45
+
46
+ cube .green [0 ][0 ],cube .green [0 ][1 ],cube .green [0 ][2 ] = tempg [0 ],tempg [1 ],tempg [2 ]
47
+ cube .orange [0 ][0 ],cube .orange [0 ][1 ],cube .orange [0 ][2 ] = tempo [0 ],tempo [1 ],tempo [2 ]
48
+ cube .blue [0 ][0 ],cube .blue [0 ][1 ],cube .blue [0 ][2 ] = tempb [0 ],tempb [1 ],tempb [2 ]
49
+ cube .red [0 ][0 ],cube .red [0 ][1 ],cube .red [0 ][2 ] = tempr [0 ],tempr [1 ],tempr [2 ]
50
+
51
+ def D ():
52
+ cube .yellow = cube .yellow [::- 1 ]
53
+ cube .yellow = cube .yellow .transpose ()
54
+
55
+ tempg = [cube .green [2 ][0 ],cube .green [2 ][1 ],cube .green [2 ][2 ]]
56
+ tempo = [cube .orange [2 ][0 ],cube .orange [2 ][1 ],cube .orange [2 ][2 ]]
57
+ tempb = [cube .blue [2 ][0 ],cube .blue [2 ][1 ],cube .blue [2 ][2 ]]
58
+ tempr = [cube .red [2 ][0 ],cube .red [2 ][1 ],cube .red [2 ][2 ]]
59
+
60
+ tempg ,tempo ,tempb ,tempr = tempo ,tempb ,tempr ,tempg
61
+
62
+ cube .green [2 ][0 ],cube .green [2 ][1 ],cube .green [2 ][2 ] = tempg [0 ],tempg [1 ],tempg [2 ]
63
+ cube .orange [2 ][0 ],cube .orange [2 ][1 ],cube .orange [2 ][2 ] = tempo [0 ],tempo [1 ],tempo [2 ]
64
+ cube .blue [2 ][0 ],cube .blue [2 ][1 ],cube .blue [2 ][2 ] = tempb [0 ],tempb [1 ],tempb [2 ]
65
+ cube .red [2 ][0 ],cube .red [2 ][1 ],cube .red [2 ][2 ] = tempr [0 ],tempr [1 ],tempr [2 ]
66
+
67
+ def F ():
68
+ cube .green = cube .green [::- 1 ]
69
+ cube .green = cube .green .transpose ()
70
+
71
+ tempw = [cube .white [2 ][0 ],cube .white [2 ][1 ],cube .white [2 ][2 ]]
72
+ tempo = [cube .orange [2 ][2 ],cube .orange [1 ][2 ],cube .orange [0 ][2 ]]
73
+ tempy = [cube .yellow [0 ][0 ],cube .yellow [0 ][1 ],cube .yellow [0 ][2 ]]
74
+ tempr = [cube .red [0 ][0 ],cube .red [1 ][0 ],cube .red [2 ][0 ]]
75
+
76
+ tempw ,tempo ,tempy ,tempr = tempo ,tempy ,tempr ,tempw
77
+
78
+ cube .white [2 ][0 ],cube .white [2 ][1 ],cube .white [2 ][2 ] = tempw [0 ],tempw [1 ],tempw [2 ]
79
+ cube .orange [0 ][2 ],cube .orange [1 ][2 ],cube .orange [2 ][2 ] = tempo [0 ],tempo [1 ],tempo [2 ]
80
+ cube .yellow [0 ][2 ],cube .yellow [0 ][1 ],cube .yellow [0 ][0 ] = tempy [0 ],tempy [1 ],tempy [2 ]
81
+ cube .red [0 ][0 ],cube .red [1 ][0 ],cube .red [2 ][0 ] = tempr [0 ],tempr [1 ],tempr [2 ]
82
+
83
+ def B ():
84
+ cube .blue = cube .blue [::- 1 ]
85
+ cube .blue = cube .blue .transpose ()
86
+
87
+ tempw = [cube .white [0 ][0 ],cube .white [0 ][1 ],cube .white [0 ][2 ]]
88
+ tempo = [cube .orange [0 ][0 ],cube .orange [1 ][0 ],cube .orange [2 ][0 ]]
89
+ tempy = [cube .yellow [2 ][2 ],cube .yellow [2 ][1 ],cube .yellow [2 ][0 ]]
90
+ tempr = [cube .red [0 ][2 ],cube .red [1 ][2 ],cube .red [2 ][2 ]]
91
+
92
+ tempw ,tempo ,tempy ,tempr = tempr ,tempw ,tempo ,tempy
93
+
94
+ cube .white [0 ][0 ],cube .white [0 ][1 ],cube .white [0 ][2 ] = tempw [0 ],tempw [1 ],tempw [2 ]
95
+ cube .orange [2 ][0 ],cube .orange [1 ][0 ],cube .orange [0 ][0 ] = tempo [0 ],tempo [1 ],tempo [2 ]
96
+ cube .yellow [2 ][0 ],cube .yellow [2 ][1 ],cube .yellow [2 ][2 ] = tempy [0 ],tempy [1 ],tempy [2 ]
97
+ cube .red [0 ][2 ],cube .red [1 ][2 ],cube .red [2 ][2 ] = tempr [0 ],tempr [1 ],tempr [2 ]
98
+
99
+ def r ():
100
+ for i in range (3 ):
101
+ R () #right
102
+
103
+ def l ():
104
+ for i in range (3 ):
105
+ L () #left
106
+
107
+ def u ():
108
+ for i in range (3 ):
109
+ U () #upper
110
+
111
+ def d ():
112
+ for i in range (3 ):
113
+ D () #down
114
+
115
+ def f ():
116
+ for i in range (3 ):
117
+ F () #front
118
+
119
+ def b ():
120
+ for i in range (3 ):
121
+ B () #back
122
+
123
+ def R2 ():
124
+ for i in range (2 ):
125
+ R () #two times right
126
+
127
+ def L2 ():
128
+ for i in range (2 ):
129
+ L () #two times left
130
+
131
+ def U2 ():
132
+ for i in range (2 ):
133
+ U () #two times up
134
+
135
+ def D2 ():
136
+ for i in range (2 ):
137
+ D () #two times down
138
+
139
+ def F2 ():
140
+ for i in range (2 ):
141
+ F () #two times front
142
+
143
+ def B2 ():
144
+ for i in range (2 ):
145
+ B () #two times back
0 commit comments