def main(): cube = Cube() print '=========== initial ============' cube.show() print cube.calculate_feature_string() print cube.check() print '' command = raw_input("Command: ").upper() while command != 'Q': if command not in command_map: print("Invalid input. Input again.") continue cube.transform(command_map[command]) print '=========== %s ============' % command print '' cube.show() print '' command = raw_input("Command: ").upper()
def test_shuffle(): cube = Cube() game = Game(cube) game.shuffle() step = len(game.shuffle_full_steps) print '=========== initialized with %s-step shuffle ============' % step cube.show() print '' print 'Feature string is ', cube.calculate_feature_string() print 'Is standard? ', cube.check() command = raw_input("Command: ").upper() while command != 'Q': if command not in command_map: print("Invalid input. Input again.") continue cube.transform(command_map[command]) print '=========== %s ============' % command print '' cube.show() print '' command = raw_input("Command: ").upper()