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
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: []