# Path: rubikscubennnsolver/RubiksSide.py
# class SolveError(Exception):
#     pass


import datetime as dt
import hashlib
import json
import logging
import os
import resource
import shutil
import subprocess
from pathlib import Path
from subprocess import call
from typing import Dict, List, TextIO, Tuple
from rubikscubennnsolver.RubiksSide import SolveError
            from rubikscubennnsolver.RubiksCube222 import rotate_222
            from rubikscubennnsolver.RubiksCube444 import rotate_444
            from rubikscubennnsolver.RubiksCube555 import rotate_555
            from rubikscubennnsolver.RubiksCube666 import rotate_666
            from rubikscubennnsolver.RubiksCube777 import rotate_777
        """
        steps = self.steps(state_to_find)

        if steps is None:
            return 0
        else:
            if self.use_isdigit:
                return int(steps[0])
            else:
                return len(steps)

    def solve_old_school(self) -> None:

        while True:
            state = self.state()

            if state in self.state_target:
                break

            steps = self.steps(state)

            if steps:
                for step in steps:
                    self.parent.rotate(step)
            else:
                raise NoSteps(f"{self}: state {state} does not have steps")

    def solve(self) -> None:

        if not self.filename_exists:

# Path: rubikscubennnsolver/RubiksSide.py
# class SolveError(Exception):
#     pass


# Path: rubikscubennnsolver/LookupTable.py
import datetime as dt
import hashlib
import json
import logging
import os
import resource
import shutil
import subprocess
from pathlib import Path
from subprocess import call
from typing import Dict, List, TextIO, Tuple
from rubikscubennnsolver.RubiksSide import SolveError
            from rubikscubennnsolver.RubiksCube222 import rotate_222
            from rubikscubennnsolver.RubiksCube444 import rotate_444
            from rubikscubennnsolver.RubiksCube555 import rotate_555
            from rubikscubennnsolver.RubiksCube666 import rotate_666
            from rubikscubennnsolver.RubiksCube777 import rotate_777

        """
        steps = self.steps(state_to_find)

        if steps is None:
            return 0
        else:
            if self.use_isdigit:
                return int(steps[0])
            else:
                return len(steps)

    def solve_old_school(self) -> None:

        while True:
            state = self.state()

            if state in self.state_target:
                break

            steps = self.steps(state)

            if steps:
                for step in steps:
                    self.parent.rotate(step)
            else:
                raise NoSteps(f"{self}: state {state} does not have steps")

    def solve(self) -> None:

        if not self.filename_exists:

            raise SolveError(f"{self.filename} does not exist")