예제 #1
0
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()
예제 #2
0
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()
예제 #3
0
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)
예제 #4
0
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)
예제 #5
0
    def assertTurnsEqual(self, turns1, turns2):
        c1 = MixupCube()
        c1.turn(turns1)

        c2 = MixupCube()
        c2.turn(turns2)

        self.assertEqual(c1, c2, '"{}" != "{}"'.format(turns1, turns2))
예제 #6
0
 def assertTurnsSolvedDist(self, turns, dist):
     cube = MixupCube()
     cube.turn(turns)
     self.assertSolvedDist(cube, dist, 'Turns "{}" '.format(turns))
예제 #7
0
 def assertNotCubeShapedTurns(self, turns):
     cube = MixupCube()
     cube.turn(turns)
     self.assertNotCubeShaped(cube)
예제 #8
0
 def assertCubeShapedTurns(self, turns):
     cube = MixupCube()
     cube.turn(turns)
     self.assertCubeShaped(cube, 'Not in cube shape: "{}"'.format(turns))
예제 #9
0
 def assertSolvedTurns(self, turns):
     cube = MixupCube()
     cube.turn(turns)
     self.assertSolved(cube, 'Not in solved state: "{}"'.format(turns))