Пример #1
0
 public static IAuto <IRubik> TurnCube(this FaceTurn turn)
 {
     return(new Auto <IRubik>(
                morphF: cube =>
     {
         return new RubikCube(
             getF: face =>
         {
             return cube[turn.Turn().Morph(face)];
         });
     }));
 }
Пример #2
0
        public static IAuto <CubieFace> Turn(this FaceTurn turn)
        {
            var rotation = turn.Axis.Rotate();

            return(new Auto <CubieFace>(
                       morphF: arrows =>
            {
                if (arrows.Cubie.Dot(turn.Axis) > 0)
                {
                    return new CubieFace(
                        cubie: rotation.Morph(arrows.Cubie),
                        face: rotation.Morph(arrows.Face));
                }

                return arrows;
            }));
        }