Exemplo n.º 1
0
 def apply_random_pattern(self):
     pattern = LittleHelpers.get_random_pattern()
     if self.verbose: print(f'Applying random pattern: {pattern}')
     moves = LittleHelpers.expand_notations(pattern.split(' '))
     for move in moves:
         self.all_moves.append(move)
     face_rotations = LittleHelpers.translate_moves_to_face_rotations(moves)
     self.append_face_rotations(face_rotations)
Exemplo n.º 2
0
 def scramble_cube(self, moves):
     format_type = type(moves)
     if format_type == list: pass
     elif format_type == str:
         moves = moves.split(' ')
     else:
         print(f'Error in the scramble_cube function. moves format is {format_type} not list (prefered) or str.')
         return 1
     moves = LittleHelpers.expand_notations(moves)
     face_rotations = LittleHelpers.translate_moves_to_face_rotations(moves)
     self.cube.scramble(face_rotations)
Exemplo n.º 3
0
 def handle_rotate_face_command(self, params):
     if params:
         moves = LittleHelpers.expand_notations(params.upper().split(' '))
         if len(moves):
             self.add_moves(moves)