Number of a cube rotations

50 Views Asked by At

I'm working on a programming puzzle where I'm dealing with colored cubes. So I have 4 distinct colors, for example black, red, green and white and each of the cube's face is painted in one of these colors. To solve the puzzle I have to somehow rotate the cube and it's actually the most difficult part to me.

I googled and found that there are 24 ways to rotate the cube, but I can't understand and imagine how it's calculated. Maybe someone could explain that in simple words? Thanks in advance.

1

There are 1 best solutions below

1
On BEST ANSWER

Imagine your cube sitting on a table so that a certain face is facing upward. You can keep the same upward face on top through four rotations of the cube (through a vertical axis through the center of the up and down faces).

So there are $6$ choices for the upward face; and $4$ rotations for each of these choices, giving a total of $24$ 'rotations of the cube'.