Nxnxn Rubik 39scube Algorithm Github Python Patched
Algorithm:
r2 B2 U2 l U2 r' U2 r U2 F2 r F2 l' B2 r2
(r = right inner slice, l = left inner slice)
cube = RubikCubeNxN(4)
Steps:
Why Python? Python’s list comprehensions and NumPy (for N>10) make rotation and state manipulation intuitive, albeit slower than C++. nxnxn rubik 39scube algorithm github python patched
r2 U2 r2 u2 r2 u2
(u = upper inner slice)
These are patched into the solver’s final stage. Algorithm: r2 B2 U2 l U2 r' U2 r U2 F2 r F2 l' B2 r2
To confirm you are using a patched version:
grep -i "parity" /path/to/solver.py
# Should show parity fix comments.
# Patched rotation function
def rotate_face_numpy(cube_array, face_index):
cube_array[face_index] = np.rot90(cube_array[face_index], k=-1)
# ... update adjacent faces using numpy indexing
git clone https://github.com/cs0ng/rubikscubennnsolver.git
cd rubikscubennnsolver
pip install -r requirements.txt
python setup.py install
from array import array self.state = [array('b', [0]) * (N*N) for _ in range(6)] # flattens each face (r = right inner slice, l = left