private int[] FromRubikPosition(LayerMove layerMove)
        {
            int layer = 0, direction = 0, clockwise = 0;

            if (layerMove.Layer == Cube3D.RubikPosition.LeftSlice)
            {
                layer     = 0;
                direction = 0;
                clockwise = layerMove.Direction ? -1 : 1;
            }
            else if (layerMove.Layer == Cube3D.RubikPosition.MiddleSlice_Sides)
            {
                layer     = 1;
                direction = 0;
                clockwise = layerMove.Direction ? -1 : 1;
            }
            else if (layerMove.Layer == Cube3D.RubikPosition.RightSlice)
            {
                layer     = 2;
                direction = 0;
                clockwise = layerMove.Direction ? -1 : 1;
            }
            else if (layerMove.Layer == Cube3D.RubikPosition.TopLayer)
            {
                layer     = 0;
                direction = 1;
                clockwise = layerMove.Direction ? -1 : 1;
            }
            else if (layerMove.Layer == Cube3D.RubikPosition.MiddleLayer)
            {
                layer     = 1;
                direction = 1;
                clockwise = layerMove.Direction ? -1 : 1;
            }
            else if (layerMove.Layer == Cube3D.RubikPosition.BottomLayer)
            {
                layer     = 2;
                direction = 1;
                clockwise = layerMove.Direction ? -1 : 1;
            }
            else if (layerMove.Layer == Cube3D.RubikPosition.FrontSlice)
            {
                layer     = 0;
                direction = 2;
                clockwise = layerMove.Direction ? -1 : 1;
            }
            else if (layerMove.Layer == Cube3D.RubikPosition.MiddleSlice)
            {
                layer     = 1;
                direction = 2;
                clockwise = layerMove.Direction ? -1 : 1;
            }
            else if (layerMove.Layer == Cube3D.RubikPosition.BackSlice)
            {
                layer     = 2;
                direction = 2;
                clockwise = layerMove.Direction ? -1 : 1;
            }
            return(new int[] { layer, direction, clockwise });
        }
 public Algorithm(string moves)
 {
     Moves = new List <LayerMove>();
     foreach (string s in moves.Split(char.Parse(" ")))
     {
         Moves.Add(LayerMove.Parse(s));
     }
 }