Esempio n. 1
0
 public void twist(Twist twist)
 {
     _cornerPosition    = twist.apply(_cornerPosition, Type.Corners);
     _cornerOrientation = twist.apply(_cornerOrientation, Type.Corners, orientation: true);
     _edgePosition      = twist.apply(_edgePosition, Type.Edges);
     _centerPosition    = twist.apply(_centerPosition, Type.Centers);
     _twists.AddLast(twist);
 }
Esempio n. 2
0
        /// <summary>
        /// The Twist R2 equals two consecutive R twists. Consequently we
        /// can easily generate the corresponding permutation arrays by applying
        /// R twice.
        /// </summary>
        private Twist(string name, Twist twist, int num)
        {
            _name             = name;
            cornerPermutation = Enumerable.Range(0, 8).ToArray();
            centerPermutation = Enumerable.Range(0, 24).ToArray();
            edgePermutation   = Enumerable.Range(0, 24).ToArray();
            pairPermutation   = Enumerable.Range(0, 12).ToArray();
            cornerOrientation = new int[8];
            pairOrientation   = new int[12];
            edgeOrientation   = new int[24];
            for (int i = 0; i < num; i++)
            {
                cornerPermutation = twist.apply(cornerPermutation, Type.Corners);
                edgePermutation   = twist.apply(edgePermutation, Type.Edges);
                centerPermutation = twist.apply(centerPermutation, Type.Centers);
                cornerOrientation = twist.apply(cornerOrientation, Type.Corners, orientation: true);
                pairPermutation   = twist.apply(pairPermutation, Type.EdgePairs);
                pairOrientation   = twist.apply(pairOrientation, Type.EdgePairs, orientation: true);
                edgeOrientation   = twist.apply(edgeOrientation, Type.Edges, orientation: true);
            }
            // Set the inverse elements; the inverse used so the search algorithm
            // does not need to return and search where its coming from
            switch (num)
            {
            case 2:
                this.inverse = this;
                break;

            case 3:
                this.inverse  = twist;
                twist.inverse = this;
                break;

            default:
                throw new SystemException("Not supported");
            }
        }
Esempio n. 3
0
 public new void twist(Twist twist)
 {
     throw new MissingMethodException("Method for oCube not supported");
 }
Esempio n. 4
0
 public static int[] twist(Twist twist, int[] positions)
 {
     return(null);
 }