Exemplo n.º 1
0
    void Test(string cmd)
    {
        _cubies.Reset();
        _cube.SortCubeGroups();
        string[] words = cmd.Split();
        foreach (string word in words)
        {
            _cube.turn(word);
        }

        CubeInfo.Cubie        cubie = null;
        List <CubeInfo.Cubie> list  = _cubies.FindTopCorners();

        foreach (CubeInfo.Cubie c in list)
        {
            if (_cubies.BottomRow(c))
            {
                cubie = c;
                break;
            }
        }
        Debug.Assert(cubie != null);

        List <string> path = new List <string>();

        SolveTopCorner_CaseBottom(cubie, ref path);

        string s = PathToString(path);

        Debug.Log("Run Test1: " + s);
        words = s.Split();
        foreach (string word in words)
        {
            _cube.turn(word);
        }
        Debug.Assert(_cubies.IsSolved(cubie));
        //Debug.Assert(s == "D' R D R");
    }