In order to implement cube representation I will need to divide cube to few separate elements.
Cube has twelve edges (two-color pieces) and eight corners (three-color pieces).
Edges that we can specify:
and this is possible corners:
As we can see we need two arrays that will contain mentioned pieces. For each of pieces we assign some integer value.
Additionally each of edges can be in two positions. It can be in correct or incorrect orientation. I will say something more about orientations in my next article.
For now I will only say that we will need second array which contains twelve boolean elements for each eadge.
There is similar situation if we talk about corners. But in this case each of corners can be in three different positions. So it will be second eight element array that will contain one of three possible values: 0 (correct orientation), 1 (clockwise orientation), 2 (anticlockwise orientation).
In next post we talk more about orientations. We will know when orientation is correct and when is not.