Esempio n. 1
0
        public static string fromScramble(int[] scramble)
        {
            CubieCube c1 = new CubieCube();
            CubieCube c2 = new CubieCube();
            CubieCube tmp;

            for (int i = 0; i < scramble.Length; i++)
            {
                c1.cornerMultiply(CubieCube.moveCube[scramble[i]]);
                c2.cornerMultiply(CubieCube.moveCube[scramble[i]]);
                tmp = c1; c1 = c2; c2 = tmp;
            }
            return(c1.toFaceCube().to_fc_String());
        }
Esempio n. 2
0
        /// <summary>
        /// Generates a random cube. </summary>
        /// <returns> A random cube in the string representation. Each cube of the cube space has the same probability. </returns>
        public static string randomCube()
        {
            CubieCube cc = new CubieCube();

            System.Random gen = new System.Random();
            cc.setFlip((short)gen.Next(CoordCube.N_FLIP));
            cc.setTwist((short)gen.Next(CoordCube.N_TWIST));
            do
            {
                cc.setURFtoDLB(gen.Next(CoordCube.N_URFtoDLB));
                cc.setURtoBR(gen.Next(CoordCube.N_URtoBR));
            } while ((cc.edgeParity() ^ cc.cornerParity()) != 0);
            FaceCube fc = cc.toFaceCube();

            return(fc.to_fc_String());
        }