Paint a cube by rolling it (Puzzle Algorithm) I stumbled across this game in Simon Tatham's puzzle app. It's called cube. The description according to the game is:

You have a grid of 16 squares, six of which are blue; on one square rests a cube. Your move is to use the arrow keys to roll the cube through 90 degrees so that it moves to an adjacent square. If you roll the cube on to a blue square, the blue square is picked up on one face of the cube; if you roll a blue face of the cube on to a non-blue square, the blueness is put down again. (In general, whenever you roll the cube, the two faces that come into contact swap colours.) Your job is to get all six blue squares on to the six faces of the cube at the same time.

Attached is a link to a screenshot of the game :

The Puzzle is available via JavaScript , hence it can be played online.
I would like to ask the Math exchange community if there is a known algorithm for solving such a problem as I haven't found anything online.
 A: After playing around with it, I believe I figured out a strategy. We have to get the colors to form a cube "net". From there, simply traverse the cube across the net.
As @DS suggested, the T shape is the easiest one to form. Now to form a T shape, we need to move the colors from one cell to the other. I found that the best strategy is to move each color through its row or column. For example, to move a color through a row, start with the cube in the cell above the cell(or below it), move down then up to "pick up" the color, move the cube across the row to where you want to place the color, then move down and up again to "put down" the color. Note that the down-up movement cancels any action done on the cells right above where we picked up and deposited the color. To maintain all of the board states, except for the deposited color, move the cube back to the initial starting cells, thereby canceling all moves done when traversing those cells.
The observation here is that the operations are reversible, if the cube went from left to right, staying in that row (except for the pickup or put down moves), then going right to left, the states of the cells traversed is maintained.
This sounds like an application of group theory and I invite anyone knowledgeable in the subject to explain it mathematically.
