I'm trying to make a Rubik's Cube Scrambler that prints a random series of movements to scramble my cube. However, sometimes my program prints two moves that cancel each other out. How can I avoid this?
This is what I have so far:
import random
scramble_length = random.randint(9,24)
move_list = ["U","U'","D","D'","B","B'","F","F'","L","L'","R","R'"]
for x in range(scramble_length):
print(random.choice(move_list))
Sorry if my code isn't that good. I'm just starting out.