#HTR subset scramble generator
import subprocess
import random
subset = input("Input subset: ")
#generate halfturns
moves = "RLUDFB"
i = 1
halfturns1 = ""
while i < random.randint(500,1000):
halfturns1 = halfturns1 + moves[random.randint(0,5)] + "2 "
i = i+1
i = 1
halfturns2 = ""
while i < random.randint(500,1000):
halfturns2 = halfturns2 + moves[random.randint(0,5)] + "2 "
i = i+1
#create scramble and command
scramble_full = halfturns1 + subset + " " + halfturns2
command = ["solve -M 20 " + scramble_full]
#clean up scramble
path = r"C:\Users\oraga\OneDrive\Desktop\New folder\nissy-2.0.6.exe"
nissy_output = subprocess.run([path] + command, capture_output=True, text=True)
i = 5
while nissy_output[-i-4] != ")":
i = i + 1
while nissy_output[i+1] != "(":
scramble = scramble + nissy_output[i]
i = i + 1
#print result
print(scramble)