lymacasm / Rubik-s-Cube

Rubiks's Cube Solver Repository
1 stars 1 forks source link

Implement the class for the Rubik's Cube #7

Closed lymacasm closed 9 years ago

lymacasm commented 9 years ago

Create a class that represents the Rubik's Cube. This class should organize all the squares on the Rubik's Cube in some manner. Each piece should contain information about the colour of the piece, and the colour of the pieces it's attached to (for side and corner pieces).

lymacasm commented 9 years ago

Initializing Rubik's Cube:

Rubiks = cube()
Rubiks.initialize()

Accessing a face of a cube:

Rubiks.CubeArray[face]

Accessing a column of a face:

Rubiks.CubeArray[face].FaceMatrix[column]

Accessing a row of a face:

for i in range(0,3):
     Rubiks.CubeArray[face].FaceMatrix[i][row]
lymacasm commented 9 years ago

The cube class is in the file, shapes.py. The corner and side squares use the function in matcher.py to match the colour of the other faces of the piece, to that particular square.