-
Notifications
You must be signed in to change notification settings - Fork 0
/
cube.py
68 lines (50 loc) · 1.33 KB
/
cube.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
import numpy as np
class Cube:
def __init__(self):
self.state = np.array([
[['W', 'W', 'W'],
['W', 'W', 'W'],
['W', 'W', 'W']],
[['R', 'R', 'R'],
['R', 'R', 'R'],
['R', 'R', 'R']],
[['B', 'B', 'B'],
['B', 'B', 'B'],
['B', 'B', 'B']],
[['Y', 'Y', 'Y'],
['Y', 'Y', 'Y'],
['Y', 'Y', 'Y']],
[['O', 'O', 'O'],
['O', 'O', 'O'],
['O', 'O', 'O']],
[['G', 'G', 'G'],
['G', 'G', 'G'],
['G', 'G', 'G']],
])
self.FRONT = self.state[0]
self.BACK = self.state[1]
self.RIGHT = self.state[2]
self.LEFT = self.state[3]
self.DOWN = self.state[4]
self.UP = self.state[5]
def reset(self):
pass
def getCube(self):
return self.state
def R(self):
buffer = np.copy(self.FRONT[:, 2])
self.FRONT[:, 2] = self.UP[:, 2]
self.UP[:, 2] = self.BACK[:, 2]
self.BACK[:, 0] = self.DOWN[:, 2]
self.DOWN[:, 2] = buffer
self.RIGHT = np.rot90(self.RIGHT)
def L(self):
pass
def U(self):
pass
def D(self):
pass
def F(self):
pass
def B(self):
pass