def prompt_args(): print('1. Timer') print('2. Simulator Interactive Mode') print('3. Kociemba Two-Phase Algorithm demonstration') print('4. Random Turn Cube Demonstration') usr = prompt_int("Select and option by its number: ", condition=lambda n: 1 <= n <= 4) options = Namespace() if usr == 1: options.behaviour = 'timer' options.dimension = prompt_int("Cube size (default 3): ", 3, lambda n: n > 0) options.inspection = prompt_number("Inspection time (default 15): ", 15.0) print('Use tags? (default no): ', end='') options.using_tags = input().startswith('y') random = None if options.dimension == 3: print( 'Use random state scrambles? This may lag on your computer. (default yes): ', end='') random = not input().startswith('n') if random: options.unofficial = None else: options.unofficial = prompt_int('How long should scrambles be? (default %d): '\ % turn.TurnSequence.default_moves(options.dimension), default=-1) return options elif usr == 2: options.behaviour = 'simulator' elif usr == 3: options.behaviour = 'demo-kociemba' elif usr == 4: options.behaviour = 'random-turns' #Set defaults if usr != 3: options.dimension = prompt_int("Choose a cube size (default 3): ", default=3, condition=lambda n: n > 1) else: options.dimension = 3 options.inspection = 15.0 options.unofficial = -1 options.using_tags = False return options
def prompt_args(): print('1. Timer') print('2. Simulator Interactive Mode') print('3. Kociemba Two-Phase Algorithm demonstration') print('4. Random Turn Cube Demonstration') usr = prompt_int("Select and option by its number: ", condition=lambda n: 1 <= n <= 4) options = Namespace() if usr != 3: options.puzzle = prompt_ln( "Puzzle type -- either 'skewb' or a cube side length (default 3): " ) else: options.puzzle = cube.Cube(3) if usr == 1: options.behaviour = 'timer' options.inspection = prompt_number("Inspection time (default 15): ", 15.0) if hasattr(options.puzzle, 'random_scramble'): print( 'Use random state scrambles? This may lag on your computer. (default yes): ', end='') random = not input().startswith('n') if random: options.unofficial = None else: options.unofficial = prompt_int('How long should scrambles be? (default %d): '\ % turn.TurnSequence.default_moves(options.size), default=-1) elif usr == 2: options.behaviour = 'simulator' elif usr == 3: options.behaviour = 'demo-kociemba' elif usr == 4: options.behaviour = 'random-turns' #Set defaults if usr == 1 or usr == 2: options.nocurses = not prompt_ln("Use curses? (y/n) (default yes): ", default='y').startswith('y') options.inspection = 15.0 options.unofficial = -1 return options
def prompt_args(): print('1. Timer') print('2. Simulator Interactive Mode') print('3. Kociemba Two-Phase Algorithm demonstration') print('4. Random Turn Cube Demonstration') usr = prompt_int("Select and option by its number: ", condition=lambda n: 1 <= n <= 4) options = Namespace() if usr == 1: options.behaviour = 'timer' options.dimension = prompt_int("Cube size (default 3): ", 3, lambda n: n > 0) options.inspection = prompt_number("Inspection time (default 15): ", 15.0) print('Use tags? (default no): ', end='') options.using_tags = input().startswith('y') random = None if options.dimension == 3: print('Use random state scrambles? This may lag on your computer. (default yes): ', end='') random = not input().startswith('n') if random: options.unofficial = None else: options.unofficial = prompt_int('How long should scrambles be? (default %d): '\ % turn.TurnSequence.default_moves(options.dimension), default=-1) return options elif usr == 2: options.behaviour = 'simulator' elif usr == 3: options.behaviour = 'demo-kociemba' elif usr == 4: options.behaviour = 'random-turns' #Set defaults if usr != 3: options.dimension = prompt_int("Choose a cube size (default 3): ", default=3, condition=lambda n: n > 1) else: options.dimension = 3 options.inspection = 15.0 options.unofficial = -1 options.using_tags = False return options
def prompt_args(): print('1. Timer') print('2. Simulator Interactive Mode') print('3. Kociemba Two-Phase Algorithm demonstration') print('4. Random Turn Cube Demonstration') usr = prompt_int("Select and option by its number: ", condition=lambda n: 1 <= n <= 4) options = Namespace() if usr != 3: options.puzzle = prompt_ln("Puzzle type -- either 'skewb' or a cube side length (default 3): ") else: options.puzzle = cube.Cube(3) if usr == 1: options.behaviour = 'timer' options.inspection = prompt_number("Inspection time (default 15): ", 15.0) if hasattr(options.puzzle, 'random_scramble'): print('Use random state scrambles? This may lag on your computer. (default yes): ', end='') random = not input().startswith('n') if random: options.unofficial = None else: options.unofficial = prompt_int('How long should scrambles be? (default %d): '\ % turn.TurnSequence.default_moves(options.size), default=-1) elif usr == 2: options.behaviour = 'simulator' elif usr == 3: options.behaviour = 'demo-kociemba' elif usr == 4: options.behaviour = 'random-turns' #Set defaults if usr == 1 or usr == 2: options.nocurses = not prompt_ln("Use curses? (y/n) (default yes): ", default='y').startswith('y') options.inspection = 15.0 options.unofficial = -1 return options