Skip to content

Instantly share code, notes, and snippets.

@connorjan
Created February 8, 2017 02:05
Show Gist options
  • Save connorjan/96eaea8870d82dfcd39f0e8fcfc28cf7 to your computer and use it in GitHub Desktop.
Save connorjan/96eaea8870d82dfcd39f0e8fcfc28cf7 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import random
faces = ["U","D","L","R","F","B"]
modifiers = ["", "'", "2"]
min_scramble_len = 16
max_scramble_length = 20
scramble = []
for i in range(0,random.choice(range(min_scramble_len, max_scramble_length+1))):
sample = random.choice(faces)
while scramble and sample == scramble[i-1][0]:
sample = random.choice(faces)
mod = random.choice(modifiers)
scramble.append(sample+mod)
print " ".join(scramble)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment