Last active
January 1, 2018 07:44
-
-
Save charlesreid1/731ca9e327909791789254703061bf40 to your computer and use it in GitHub Desktop.
Script to test if a Rubiks Revenge cube has a cross on the side.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uses this rubiks cube solver: | |
# https://github.com/dwalton76/rubiks-cube-NxNxN-solver | |
from rubikscubennnsolver.RubiksCube444 import RubiksCube444, solved_4x4x4 | |
from pprint import pprint | |
def get_cube(): | |
""" | |
Get a 4x4 Rubiks Cube. | |
""" | |
order = 'URFDLB' | |
cube = RubiksCube444(solved_4x4x4, order) | |
return cube | |
rr = get_cube() | |
rr.print_cube() | |
# Apply this sequence 3 times to a solved cube, and the cross pattern re-appears on each face. | |
# Apply this sequence 6 times to a solved cube, and the entire cube returns to solved state. | |
sequence = ["U","L","U'","L'"] | |
for move in sequence: | |
rr.rotate(move) | |
for move in sequence: | |
rr.rotate(move) | |
for move in sequence: | |
rr.rotate(move) | |
rr.print_cube() | |
rr.crosses_solved() | |
for move in sequence: | |
rr.rotate(move) | |
for move in sequence: | |
rr.rotate(move) | |
for move in sequence: | |
rr.rotate(move) | |
rr.print_cube() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment