Hello,
I am just learning Python and Pygame, and I am trying to create my own puzzle timer. I am struggling with creating a basic scrambler function that does not repeat moves, i.e., U2 U'. So far, I have this:
Any help would be greatly appreciated!
-DTCuber
P.S. Sorry for the massive bump.
I am just learning Python and Pygame, and I am trying to create my own puzzle timer. I am struggling with creating a basic scrambler function that does not repeat moves, i.e., U2 U'. So far, I have this:
Code:
#Import libraries
import random
#Function that creates scrambling sequences
def scramble():
#Create list with turns
turns = ["R ","R' ","R2 ","L ","L' ","L2 ","F ","F' ","F2 ","B ","B' ","B2 ","U ","U' ","U2 ","D ","D' ","D2 "]
#Initialize empty string for scramble
random_scramble=""
#Generate 20 random turns and store in string
for i in range(0,20):
random_scramble+=random.choice(turns)
#Return string
return random_scramble
Any help would be greatly appreciated!
-DTCuber
P.S. Sorry for the massive bump.