def get_fake_555(self):
     if self.fake_555 is None:
         self.fake_555 = RubiksCube555ForNNN(solved_555, "URFDLB")
         self.fake_555.cpu_mode = self.cpu_mode
         self.fake_555.lt_init()
         self.fake_555.enable_print_cube = False
     else:
         self.fake_555.re_init()
     return self.fake_555
 def get_fake_555(self):
     if self.fake_555 is None:
         if self.fake_777 and self.fake_777.fake_555:
             self.fake_555 = self.fake_777.fake_555
             self.fake_555.cpu_mode = self.cpu_mode
             self.fake_555.re_init()
             self.fake_555.enable_print_cube = False
         else:
             # Because our centers are already solved we get very little benefit
             # from using the more advanced 555 edge pairing code path...and it
             # takes much longer to run.  For now use the old L4E way it is only
             # about 1 move longer if the centers are solved but runs 3x faster.
             self.fake_555 = RubiksCube555ForNNN(solved_555, 'URFDLB')
             self.fake_555.enable_print_cube = False
             self.fake_555.cpu_mode = self.cpu_mode
             self.fake_555.lt_init()
     else:
         self.fake_555.re_init()
     return self.fake_555
예제 #3
0
    elif size == 3:
        from rubikscubennnsolver.RubiksCube333 import RubiksCube333
        cube = RubiksCube333(args.state, args.order, args.colormap, args.debug)
    elif size == 4:
        from rubikscubennnsolver.RubiksCube444 import RubiksCube444, solved_444
        cube = RubiksCube444(args.state,
                             args.order,
                             args.colormap,
                             avoid_pll=True,
                             debug=args.debug)
    elif size == 5:
        from rubikscubennnsolver.RubiksCube555 import solved_555

        if cpu_mode == "fast":
            from rubikscubennnsolver.RubiksCube555ForNNN import RubiksCube555ForNNN
            cube = RubiksCube555ForNNN(args.state, args.order, args.colormap,
                                       args.debug)
        else:
            from rubikscubennnsolver.RubiksCube555 import RubiksCube555
            cube = RubiksCube555(args.state, args.order, args.colormap,
                                 args.debug)

    elif size == 6:
        from rubikscubennnsolver.RubiksCube666 import RubiksCube666
        cube = RubiksCube666(args.state, args.order, args.colormap, args.debug)
    elif size == 7:
        from rubikscubennnsolver.RubiksCube777 import RubiksCube777
        cube = RubiksCube777(args.state, args.order, args.colormap, args.debug)
    elif size % 2 == 0:
        from rubikscubennnsolver.RubiksCubeNNNEven import RubiksCubeNNNEven
        cube = RubiksCubeNNNEven(args.state, args.order, args.colormap,
                                 args.debug)
import sys

logging.basicConfig(
    level=logging.INFO, format="%(asctime)s %(filename)20s %(levelname)8s: %(message)s"
)
log = logging.getLogger(__name__)

# Color the errors and warnings in red
logging.addLevelName(
    logging.ERROR, "\033[91m   %s\033[0m" % logging.getLevelName(logging.ERROR)
)
logging.addLevelName(
    logging.WARNING, "\033[91m %s\033[0m" % logging.getLevelName(logging.WARNING)
)

cube = RubiksCube555ForNNN(solved_555, "URFDLB")
cube.lt_init()

with open("results.txt", "w") as fh_results:
    with open("lookup-table-5x5x5-step301-edges-x-plane-edges-only.txt", "r") as fh:
        for (line_number, line) in enumerate(fh):
            cube.re_init()
            (state, steps_to_solve) = line.strip().split(":")
            steps_to_solve = steps_to_solve.split()
            steps_to_scramble = reverse_steps(steps_to_solve)

            for step in steps_to_scramble:
                cube.rotate(step)

            # put the centers back to solved
            for side in cube.sides.values():
예제 #5
0
        # solve the cube
        if size == '2x2x2':
            cube = RubiksCube222(solved_222, order)

        elif size == '3x3x3':
            cube = RubiksCube333(solved_333, order)

        elif size == '4x4x4':
            cube = RubiksCube444(solved_444, order)

        elif size == '5x5x5':
            from rubikscubennnsolver.RubiksCube555 import solved_555

            if cpu_mode == "fast":
                from rubikscubennnsolver.RubiksCube555ForNNN import RubiksCube555ForNNN
                cube = RubiksCube555ForNNN(solved_555, order)
            else:
                from rubikscubennnsolver.RubiksCube555 import RubiksCube555
                cube = RubiksCube555(solved_555, order)

        elif size == '6x6x6':
            cube = RubiksCube666(solved_666, order)

        elif size == '7x7x7':
            cube = RubiksCube777(solved_777, order)

        elif size == '8x8x8':
            cube = RubiksCubeNNNEven(solved_888, order)

        elif size == '9x9x9':
            cube = RubiksCubeNNNOdd(solved_999, order)