Project Cube Solver #06 – Theory of cube implementation

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:

  • UF
  • UL
  • UB
  • UR
  • DF
  • DL
  • DB
  • DR
  • FL
  • BL
  • BR
  • FR

and this is possible corners:

  • UFR
  • UFL
  • UBL
  • UBR
  • DFR
  • DFL
  • DBL
  • DBR

As we can see we need two arrays that will contain mentioned pieces. For each of pieces we assign some integer value.

Edges:

Edge UF UL UB UR DF DL DB DR FL BL BR FR
Value 0 1 2 3 4 5 6 7 8 9 10 11

Corners:

Corner UFR UFL UBL UBR DFR DFL DBL DBR
Value 0 1 2 3 4 5 6 7

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.

Leave a Reply

Your email address will not be published. Required fields are marked *