def playmode(self): self.timer.go(self.mode) while True: c = getch() if c == ' ': self.timer.stop() return
def cubemode(): cube = loadCube() print(cube) while True: c = getch() if c == 'q': return -1 if c == 'n': cube = loadCube() print(cube) if c in ['u', 'f', 'l', 'r', 'b', 'd']: cube.move(c) print(cube)
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': print(self.history.getlast(self.mode, 2)) # p = print last 2 solves 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") if c == 'm': # m = switch modes(3x3,oh, etc.) self.changemode()
def start(): create_states() print_menu() word = "" while True: # Gets new symbol from user char = getch() # Exits on Esc/Escape if char == b'\x1B': break # Restart the cycle on Enter/Return or whitespace elif char == b'\x0D' or char == " ": word = "" print else: if is_acceptable_input(word, char): word += char # prints the user entered symbol if it's allowed sys.stdout.write(char)