Ejemplo n.º 1
0
 def interactive(self):
     while True:
         c = getch()  # commands:
         if c == "p":  # p = scrambles the cube
             self.feedCube(scramble.scramble())
         if c == "q":  # q = exit cubemode
             return -1
         if c == "n":  # n = loads new cube(solved)
             self.cube = loadCube()
             print(self.cube)
         if c.lower() in {"u", "f", "l", "r", "b", "d", "m", "e", "s"}:  # moves the slice (shift inverts move)
             self.cube.move(c)
             print(self.cube)
         if c.lower() in {"x", "y", "z"}:
             for turn in opscube.rotMoves(c):
                 self.cube.move(turn)
             print(self.cube)
         if c == "1":
             doublemove = opscube.doubleMoves("d")
             for move in doublemove:
                 self.cube.move(move)
             print(self.cube)
Ejemplo n.º 2
0
 def __init__(self, alg=[], interactive=False, printall=False):
     self.cube = loadCube()
     self.alg = alg
     self.feedCube(alg, printall)
     if interactive:
         self.interactive()