def main(): import sys cube = MixupCube() if len(sys.argv) == 2: cube.turn(sys.argv[1]) print("Initial Cube:", cube) viewer = CubeViewer(cube) print() print("Keys:") for b in viewer.get_key_bindings(): print(" {} - {}".format('/'.join(b.keys), b.name)) print(" {}".format(b.help)) print() print("Mouse:") print(" Click - Select Cubie") print(" Drag - Rotate Camera") print(" Middle Click - Swap Cubie with selected.") print() glutMainLoop()
def main(): cube_str = ''.join(sys.argv[1:]).strip() if cube_str.startswith('['): cube = MixupCube.from_str(cube_str) else: cube = MixupCube() cube.turn(cube_str) solve(cube)
def assertTurnsEqual(self, turns1, turns2): c1 = MixupCube() c1.turn(turns1) c2 = MixupCube() c2.turn(turns2) self.assertEqual(c1, c2, '"{}" != "{}"'.format(turns1, turns2))
def assertTurnsSolvedDist(self, turns, dist): cube = MixupCube() cube.turn(turns) self.assertSolvedDist(cube, dist, 'Turns "{}" '.format(turns))
def assertNotCubeShapedTurns(self, turns): cube = MixupCube() cube.turn(turns) self.assertNotCubeShaped(cube)
def assertCubeShapedTurns(self, turns): cube = MixupCube() cube.turn(turns) self.assertCubeShaped(cube, 'Not in cube shape: "{}"'.format(turns))
def assertSolvedTurns(self, turns): cube = MixupCube() cube.turn(turns) self.assertSolved(cube, 'Not in solved state: "{}"'.format(turns))