Пример #1
0
        internal int verify(string facelets)
        {
            int count = 0x000000;

            try
            {
                string center = new string(
                    new char[] {
                    facelets[Util.U5],
                    facelets[Util.R5],
                    facelets[Util.F5],
                    facelets[Util.D5],
                    facelets[Util.L5],
                    facelets[Util.B5]
                }
                    );
                for (int i = 0; i < 54; i++)
                {
                    int pos = center.IndexOf(facelets[i]);
                    if (pos == -1)
                    {
                        return(-1);
                    }
                    f[i]   = (byte)pos;
                    count += 1 << (f[i] << 2);
                }
            }
            catch (Exception)
            {
                return(-1);
            }
            if (count != 0x999999)
            {
                return(-1);
            }
            Util.toCubieCube(f, cc);
            return(cc.verify());
        }