public LinkedList <Twist> search(Cube cube)
        {
            Node goalNode = new Node(Enumerable.Range(0, 8).ToArray(), Enumerable.Range(0, 12).ToArray(), null);

            bfSearch.goalID = goalNode.getID();
            return(bfSearch.search(new Node(cube.CornerPosition, cube.PairPosition, null)));
        }
Example #2
0
        public LinkedList <Twist> search(Cube cube)
        {
            Node goalNode = new Node(new int[12], null);

            bfSearch.goalID = goalNode.getID();
            return(bfSearch.search(new Node(cube.PairOrientation, null)));
        }
        public LinkedList <Twist> search(Cube cube)
        {
            Node goalNode = new Node(Cube.OriginalCube.CenterPosition, null);

            bfSearch.goalID = goalNode.getID();
            return(bfSearch.search(new Node(cube.CenterPosition, null)));
        }
Example #4
0
 public LinkedList <Twist> search(Cube cube)
 {
     cube            = cube.Clone(cloneTwists: false);
     BFSearch.goalID = new Node(Cube.OriginalCube.EdgePosition,
                                Cube.OriginalCube.EdgeOrientation, Cube.OriginalCube.CenterPosition, 0, null).getID();
     for (int stage = 1; stage <= 3; stage++)
     {
         Node node = new Node(cube.EdgePosition,
                              cube.EdgeOrientation, cube.CenterPosition, stage, null);
         LinkedList <Twist> twists =
             stage == 1 ?
             BFSearch.search(node) :
             IDASearch.search(node, 20);
         cube.twist(twists);
     }
     return(cube.Twists);
 }