lymacasm / Rubik-s-Cube

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

Add the coordinates for the other positions of the same shape #14

Closed batesandy123 closed 9 years ago

batesandy123 commented 9 years ago

Every shape should have the knowledge of what other face it is on and where. I am going to modify matcher.py to allow each square to know the location of the other squares it may be attached too. This will make it easier to implement algorithms as more information will be available to the programmer. The API will not have a serous impact on performance

For example: Rubik.FaceMatrix[2].CubeArray[2,0].connections

returns: [ {face: 3, cords:[2,2] }, { face: 4, cords:[ 0,0 ] } ]

Example: Rubik.FaceMatrix[4].CubeArray[2,1].connections

returns: [ { face: 4, cords:[ 0,1 ] } ]

Example: Rubik.FaceMatrix[4].CubeArray[1,1].connections

returns: []