Rubik::Model
version 0.4
This module is responsible for persisting the state of the Rubik's cube between rotations of sides , and also it maps the set 1..54 to the facelets of the cube.
There is a 3x3x3 array called C that stores the cubies
C[x][y][z] with x,y,z ranging in 0,1,2
It will contain what cube is in that position
A rotation of the front face at 90 degrees clockwise will be like this
0 , 1 , 2 6 , 3 , 0 3 , 4 , 5 ===> 7 , 4 , 1 6 , 7 , 8 8 , 5 , 2
The following correspondence between C and the faces of the cube :
C[x][y][0] is Front C[x][y][2] is Back C[x][0][z] is Up C[x][2][z] is Down C[0][y][z] is Left C[2][y][z] is Right
Each of the cubies will have 1,2,3 facelets visible depending on wether it is a center, a edge or a corner.
Stefan Petrea, <stefan.petrea at gmail.com>
<stefan.petrea at gmail.com>
To install CM::Permutation, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CM::Permutation
CPAN shell
perl -MCPAN -e shell install CM::Permutation
For more information on module installation, please visit the detailed CPAN module installation guide.