コード例 #1
0
ファイル: timer.py プロジェクト: drumsen/pycube
 def playmode(self):
     self.timer.go(self.mode)
     while True:
         c = getch()
         if c == ' ':
             self.timer.stop()
             self.history.solvecount += 1
             print('\n')
             return
コード例 #2
0
ファイル: timer.py プロジェクト: drumsen/pycube
 def configmode(self):
     while True:
         c = getch()
         if c == ' ':
             break                                     # space = start next solve
         if c == 'q':                                  # q = exit timer mode
             print("Quit Timer\n")
             return -1
         if c == 'p':
             # p = print last 2 solves
             print(self.history.getlast(self.mode, 2))
         if c == 'f':
             self.history.deletelast()                 # f = delete last solve
         if c == 'd':                                  # d = set last solve as dnf
             self.history.set_dnf()
             print("DNF nub\n0.00", end="\r")
         if c == '2':                                  # 2 = set last solve as plustwo
             self.history.set_plustwo()
             print("+2 nub\n0.00", end="\r")           # m = switch modes(3x3,oh, etc.)
         if c == 'm':
             self.changemode()
コード例 #3
0
ファイル: playcube.py プロジェクト: drumsen/pycube
 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)