Beispiel #1
0
def _R(cube, clockwise=True):
    rotate_face(cube.faces[4], clockwise)
    cycle_4(faces=[cube.faces[i] for i in [3, 0, 1, 5]],
            edges=[
                Edge.RIGHT(ascending_indices=False),
                Edge.RIGHT(ascending_indices=False),
                Edge.LEFT(),
                Edge.RIGHT(ascending_indices=False)
            ],
            clockwise=clockwise)
Beispiel #2
0
def _B(cube, clockwise=True):
    rotate_face(cube.faces[1], clockwise)
    cycle_4(faces=[cube.faces[i] for i in [2, 5, 4, 0]],
            edges=[
                Edge.LEFT(),
                Edge.BOTTOM(),
                Edge.RIGHT(ascending_indices=False),
                Edge.TOP(ascending_indices=False)
            ],
            clockwise=clockwise)
def test_cycle_4_cw_1():
    """
    See `cube_solver.cube`
    faces: 2, 0, 4, 5
    """
    faces = [[[A, B, C], [D, E, F], [G, H, I]],
             [[J, K, L], [M, N, O], [P, Q, R]],
             [[S, T, U], [V, W, X], [Y, Z, Z2]],
             [[A2, B2, C2], [D2, E2, F2], [G2, H2, I2]]]

    edges = [
        Edge.RIGHT(ascending_indices=False),
        Edge.BOTTOM(),
        Edge.LEFT(),
        Edge.TOP(ascending_indices=False)
    ]
    expected_cycled_faces = [[[A, B, A2], [D, E, B2], [G, H, C2]],
                             [[J, K, L], [M, N, O], [I, F, C]],
                             [[P, T, U], [Q, W, X], [R, Z, Z2]],
                             [[Y, V, S], [D2, E2, F2], [G2, H2, I2]]]

    cycle_4(faces=faces, edges=edges, clockwise=True)
    assert expected_cycled_faces == faces