Skip to content

Instantly share code, notes, and snippets.

@Berkmann18
Created December 7, 2014 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Berkmann18/e0a2d28d5734966c8ab6 to your computer and use it in GitHub Desktop.
Save Berkmann18/e0a2d28d5734966c8ab6 to your computer and use it in GitHub Desktop.
RC Scrambler: a Multi-event Scrambler for every cubing events including the unofficial ones
//String str333, str444, str222, strMeg, strCopter, strPyr;
Board scrambles = new Board(true, false, false, false, false, false, true, false, true, false, false, false, true, false, false, false, false, false, false, false, false,
false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, true);
color[] clr = {color(255, 255, 0), color(255, 127, 0), color(0, 0, 255), color(255, 0, 0), color(0, 255, 0), color(255), color(0), color(127), color(0, 255, 255), color(255, 0, 255)};
boolean wcaValid = true;
void setup(){
size(1450, 800);
smooth();
background(32);
//frame.setTitle("RC Scrambler");
noLoop();
fill(clr[(int)random(clr.length)]);
noStroke();
rect(0, 0, 20, height);
}
void draw(){
fill(255);
/*str222 = scramble("222", wcaValid);
str333 = scramble("333", wcaValid);
str444 = scramble("444", wcaValid);
strMeg = scramble("Meg", wcaValid);
strCopter = scramble("Copter", false);
scrambles.sc222 = str222;
scrambles.sc333 = str333;
scrambles.sc444 = str444;
scrambles.scMeg = strMeg;
scrambles.scCopter = strCopter;*/
scrambles.randomAlgs(wcaValid);
//scrambles.multiAlgs("333", 12, true);
scrambles.refresh();
//scrambles.multiAlgs("Sq1", 1, true);
//String[] TwoGMvs = {"U", "R"};
//scrambles.sc333 = subsetScramble("FaceMoves", TwoGMvs);
scrambles.display();
String[] sc_list = split(scrambles.printedTxt, '|');
// Writes the strings to a file, each on a separate line
saveStrings("scrambles.txt", sc_list);
}
void keyPressed(){
println("re scrambling");
background(32);
fill(clr[(int)random(clr.length)]);
noStroke();
rect(0, 0, 20, height);
scrambles.refresh();
//scrambles = new Board(true, false, false, false, false, false, true, false, true, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, true);
scrambles.randomAlgs(wcaValid);
scrambles.display();
}
class Board {
int nbCatUsed = 0, nbCatTotal = 39;
boolean has222 = false, has2Bf = false, has2OH = false, has2FM = false, has2Ft = false, has2MBf = false,
has333 = false, has3Bf = false, has3OH = false, has3FM = false, has3Ft = false, has3MBf = false,
has444 = false, has4Bf = false, has4OH = false, has4FM = false, has4Ft = false, has4MBf = false,
has555 = false, has5Bf = false, has5Ft = false, has666 = false, has777 = false, has888 = false,
hasMeg = false, hasGig = false, hasPet = false, hasTer = false, hasTutt = false, has2Pyr = false, hasPyr = false, has4Pyr = false, has5Pyr = false,
hasSq1 = false, hasSq2 = false, hasSq3 = false, hasClock = false, hasSkewb = false, hasCopter = false, wca = true;
String table, sc222, sc2Bf, sc2OH, sc2FM, sc2Ft, sc2MBf, sc333, sc3Bf, sc3OH, sc3FM, sc3Ft, sc3MBf, sc444, sc4Bf, sc4OH, sc4FM, sc4Ft, sc4MBf, sc555, sc5Bf, sc5Ft,
sc666, sc777, sc888, scMeg, scGig, scPet, scTer, scTutt, sc2Pyr, scPyr, sc4Pyr, sc5Pyr, scSq1, scSq2, scSq3, scClock, scSkewb, scCopter, printedTxt = "";
boolean[] wcaValided = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, false, false, false, false, false, true, false, false, true, false, false, true, true, false};
Board(boolean p222, boolean p2Bf, boolean p2OH, boolean p2FM, boolean p2Ft, boolean p2MBf, boolean p333, boolean p3Bf, boolean p3OH, boolean p3FM, boolean p3Ft, boolean p3MBf, boolean p444, boolean p4Bf, boolean p4OH, boolean p4FM, boolean p4Ft, boolean p4MBf, boolean p555, boolean p5Bf, boolean p5Ft,
boolean p666, boolean p777, boolean p888, boolean pMeg, boolean pGig, boolean pPet, boolean pTer, boolean pTutt, boolean p2Pyr, boolean pPyr, boolean p4Pyr, boolean p5Pyr, boolean pSq1, boolean pSq2, boolean pSq3, boolean pClock, boolean pSkewb, boolean pCopter){
has222 = p222; has2Bf = p2Bf; has2OH = p2OH; has2FM = p2FM; has2Ft = p2Ft; has2MBf = p2MBf;
has333 = p333; has3Bf = p3Bf; has3OH = p3OH; has3FM = p3FM; has3Ft = p3Ft; has3MBf = p3MBf;
has444 = p444; has4Bf = p4Bf; has4OH = p4OH; has4FM = p4FM; has4Ft = p4Ft; has4MBf = p4MBf;
has555 = p555; has5Bf = p5Bf; has5Ft = p5Ft; has666 = p666; has777 = p777; has888 = p888;
hasMeg = pMeg; hasGig = pGig; hasPet = pPet; hasTer = pTer; hasTutt = pTutt; has2Pyr = p2Pyr; hasPyr = pPyr; has4Pyr = p4Pyr; has5Pyr = p5Pyr;
hasSq1 = pSq1; hasSq2 = pSq2; hasSq3 = pSq3; hasClock = pClock; hasSkewb = pSkewb; hasCopter = pCopter;
if(nbCatUsed==0){
if(has222) nbCatUsed++;if(has2Bf) nbCatUsed++;if(has2OH) nbCatUsed++;if(has2FM) nbCatUsed++;if(has2Ft) nbCatUsed++;if(has2MBf) nbCatUsed++;
if(has333) nbCatUsed++;if(has3Bf) nbCatUsed++;if(has3OH) nbCatUsed++;if(has3FM) nbCatUsed++;if(has3Ft) nbCatUsed++;if(has3MBf) nbCatUsed++;
if(has444) nbCatUsed++;if(has4Bf) nbCatUsed++;if(has4OH) nbCatUsed++;if(has4FM) nbCatUsed++;if(has4Ft) nbCatUsed++;if(has4MBf) nbCatUsed++;
if(has555) nbCatUsed++;if(has5Bf) nbCatUsed++;if(has5Ft) nbCatUsed++;if(has666) nbCatUsed++;if(has777) nbCatUsed++;if(has888) nbCatUsed++;
if(hasMeg) nbCatUsed++;if(hasGig) nbCatUsed++;if(hasPet) nbCatUsed++;if(hasTer) nbCatUsed++;if(hasTutt) nbCatUsed++;if(has2Pyr) nbCatUsed++;if(hasPyr) nbCatUsed++;if(has4Pyr) nbCatUsed++;if(has5Pyr) nbCatUsed++;
if(hasSq1) nbCatUsed++;if(hasSq2) nbCatUsed++;if(hasSq3) nbCatUsed++;if(hasClock) nbCatUsed++;if(hasSkewb) nbCatUsed++;if(hasCopter) nbCatUsed++;}
}
void display(){
table = "";
println("displaying the scramble board");
String[] cats = {"222", "2Bf", "2OH", "2FM", "2Ft", "2MBf", "333", "3Bf", "3OH", "3FM", "3Ft", "3MBf", "444", "4Bf", "4OH", "4FM", "4Ft", "4MBf", "555", "5Bf", "5Ft", "666", "777", "888", "Meg", "Gig", "Pet", "Ter", "Tutt", "2Pyr", "Pyr", "4Pyr", "5Pyr", "Sq1", "Sq2", "Sq3", "Clock", "Skewb", "Copter"},
scs = {sc222, sc2Bf, sc2OH, sc2FM, sc2Ft, sc2MBf, sc333, sc3Bf, sc3OH, sc3FM, sc3Ft, sc3MBf, sc444, sc4Bf, sc4OH, sc4FM, sc4Ft, sc4MBf, sc555, sc5Bf, sc5Ft, sc666, sc777, sc888, scMeg, scGig, scPet, scTer, scTutt, sc2Pyr, scPyr, sc4Pyr, sc5Pyr, scSq1, scSq2, scSq3, scClock, scSkewb, scCopter};
boolean[] perm = {has222, has2Bf, has2OH, has2FM, has2Ft, has2MBf, has333, has3Bf, has3OH, has3FM, has3Ft, has3MBf, has444, has4Bf, has4OH, has4FM, has4Ft, has4MBf, has555, has5Bf, has5Ft, has666, has777, has888, hasMeg, hasGig, hasPet, hasTer, hasTutt, has2Pyr, hasPyr, has4Pyr, has5Pyr, hasSq1, hasSq2, hasSq3, hasClock, hasSkewb, hasCopter};
stroke(255);noFill();
textSize(30);
int nb = 1;
float a=0;
for(int i=0; i<cats.length; i++){
if(perm[i]){
if(scs[i]==null||scs[i]=="null"){
if(wcaValided[i]) scs[i] = scramble(cats[i], true);
else scs[i] = scramble(cats[i], false);
}
table += cats[i] + ": "+scs[i]+"\n";
//boolean c=((i%3)*30+i)==i;
if(i>21 && i<=24) a=0.5;
else if(i>24 && i<=28) a=1.5;
else if(i>28) a=2.5;
int l=round((i%(cats.length-1))+(1.5+a)*nb*30);
//println(cats[i]+": round(("+i+"%"+(int)(cats.length-1)+")+(1.5+"+a+")*"+nb+"*30="+l);
text(cats[i] + ": "+scs[i], 30, l);//(i%3+1)*30, i*30+15);
if(nb<nbCatUsed) nb++;
printedTxt += cats[i] + ": "+scs[i]+"|";
}
}
//text(table, 30, 30);
println(table);
}
void randomAlgs(boolean wca){
println("generating random stats/moves/algorithms");
String[] cats = {"222", "2Bf", "2OH", "2FM", "2Ft", "2MBf", "333", "3Bf", "3OH", "3FM", "3Ft", "3MBf", "444", "4Bf", "4OH", "4FM", "4Ft", "4MBf", "555", "5Bf", "5Ft", "666", "777", "888", "Meg", "Gig", "Pet", "Ter", "Tutt", "2Pyr", "Pyr", "4Pyr", "5Pyr", "Sq1", "Sq2", "Sq3", "Clock", "Skewb", "Copter"},
scs = {sc222, sc2Bf, sc2OH, sc2FM, sc2Ft, sc2MBf, sc333, sc3Bf, sc3OH, sc3FM, sc3Ft, sc3MBf, sc444, sc4Bf, sc4OH, sc4FM, sc4Ft, sc4MBf, sc555, sc5Bf, sc5Ft, sc666, sc777, sc888, scMeg, scGig, scPet, scTer, scTutt, sc2Pyr, scPyr, sc4Pyr, sc5Pyr, scSq1, scSq2, scSq3, scClock, scSkewb, scCopter};
boolean[] perm = {has222, has2Bf, has2OH, has2FM, has2Ft, has2MBf, has333, has3Bf, has3OH, has3FM, has3Ft, has3MBf, has444, has4Bf, has4OH, has4FM, has4Ft, has4MBf, has555, has5Bf, has5Ft, has666, has777, has888, hasMeg, hasGig, hasPet, hasTer, hasTutt, has2Pyr, hasPyr, has4Pyr, has5Pyr, hasSq1, hasSq2, hasSq3, hasClock, hasSkewb, hasCopter};
for(int i=0; i<cats.length; i++){
if(perm[i]){
scs[i] = scramble(cats[i], wcaValided[i]);
if(scs[i]==null||scs[i]=="null") println("Nooo");
}
}
}
void refresh(){
println("refreshing");
nbCatUsed = 0; nbCatTotal = 39;
has222 = false; has2Bf = false; has2OH = false; has2FM = false; has2Ft = false; has2MBf = false;
has333 = false; has3Bf = false; has3OH = false; has3FM = false; has3Ft = false; has3MBf = false;
has444 = false; has4Bf = false; has4OH = false; has4FM = false; has4Ft = false; has4MBf = false;
has555 = false; has5Bf = false; has5Ft = false; has666 = false; has777 = false; has888 = false;
hasMeg = false; hasGig = false; hasPet = false; hasTer = false; hasTutt = false; has2Pyr = false; hasPyr = false; has4Pyr = false; has5Pyr = false;
hasSq1 = false; hasSq2 = false; hasSq3 = false; hasClock = false; hasSkewb = false; hasCopter = false; wca = true;
table=""; sc222=""; sc2Bf=""; sc2OH=""; sc2FM=""; sc2Ft=""; sc2MBf=""; sc333=""; sc3Bf=""; sc3OH=""; sc3FM=""; sc3Ft=""; sc3MBf=""; sc444=""; sc4Bf=""; sc4OH=""; sc4FM=""; sc4Ft=""; sc4MBf=""; sc555=""; sc5Bf=""; sc5Ft="";
sc666=""; sc777=""; sc888=""; scMeg=""; scGig=""; scPet=""; scTer=""; scTutt=""; sc2Pyr=""; scPyr=""; sc4Pyr=""; sc5Pyr=""; scSq1=""; scSq2=""; scSq3=""; scClock=""; scSkewb=""; scCopter="";
boolean[] wcav = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, false, false, false, false, false, true, false, false, true, false, false, true, true, false};
wcaValided = wcav;
printedTxt = "";
}
void multiAlgs(String cat, int n, boolean wca){
textSize(60);
String wv = (wca)? "WCA valid": "";
text(cat+" "+wv, width/2, 60);
textSize(30);
for(int i=0; i<n; i++){
text(i+". "+scramble(cat, wca), 30, 30*i+90);
printedTxt += i+". "+scramble(cat, wca)+"|";
}
}
}
String scramble(String cat, boolean wca){
//println("generating a "+cat+" scramble");
String algo = "";
if(cat.equals("222")||cat.equals("2Bf")||cat.equals("2OH")||cat.equals("2FM")||cat.equals("2Ft")||cat.equals("2MBf")){
if(!wca){
String[] move = {"F", "F'", "F2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "B", "B'", "B2", "x", "x'", "x2", "y", "y'", "y2", "z", "z'", "z2"}, alg = new String[11];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0) == m.charAt(0)) m = move[int(random(move.length))];//avoid repetition of moves on the same layer/face
if(alg[i-1] == m || alg[i-1].charAt(0) == m.charAt(0)) m = move[int(random(move.length))];//double security
if(i>1){
if(alg[i-2].charAt(0) == 'F' && alg[i-2].charAt(0) == m.charAt(0) && (alg[i-1].charAt(0) == 'z' || alg[i-1].charAt(0) == 'B')){
if(alg[i-1].charAt(0) == 'z'){
String notF[] = {"B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "x", "x'", "x2", "y", "y'", "y2"};
m = notF[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'B'){
String notF[] = {"L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2"};
m = notF[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'B' && alg[i-2].charAt(0) == m.charAt(0) && (alg[i-1].charAt(0) == 'z' || alg[i-1].charAt(0) == 'F')){
if(alg[i-1].charAt(0) == 'z'){
String notB[] = {"F", "F'", "F2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "x", "x'", "x2", "y", "y'", "y2"};
m = notB[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'F'){
String notB[] = {"L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2"};
m = notB[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'L' && alg[i-2].charAt(0) == m.charAt(0) && (alg[i-1].charAt(0) == 'x' || alg[i-1].charAt(0) == 'R')){
if(alg[i-1].charAt(0) == 'x'){
String notL[] = {"F", "F'", "F2", "B", "B'", "B2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "y", "y'", "y2"};
m = notL[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'R'){
String notL[] = {"F", "F'", "F2", "B", "B'", "B2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2"};
m = notL[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'R' && alg[i-2].charAt(0) == m.charAt(0) && (alg[i-1].charAt(0) == 'x' || alg[i-1].charAt(0) == 'L')){
if(alg[i-1].charAt(0) == 'x'){
String notR[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "y", "y'", "y2"};
m = notR[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'L'){
String notR[] = {"F", "F'", "F2", "B", "B'", "B2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2"};
m = notR[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'U' && alg[i-2].charAt(0) == m.charAt(0) && (alg[i-1].charAt(0) == 'y' || alg[i-1].charAt(0) == 'D')){
if(alg[i-1].charAt(0) == 'y'){
String notU[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2"};
m = notU[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'D'){
String[] notU = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2"};
m = notU[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'D' && alg[i-2].charAt(0) == m.charAt(0) && (alg[i-1].charAt(0) == 'y' || alg[i-1].charAt(0) == 'U')){
if(alg[i-1].charAt(0) == 'y'){
String notD[] = {"U", "U'", "U2", "F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "z", "z'", "z2", "x", "x'", "x2"};
m = notD[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'U'){
String notD[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2"};
m = notD[int(random(move.length))];
}
}
}
}
alg[i] = m;
}
algo = join(alg, " ");
}else{
String[] move = {"F", "F'", "F2", "R", "R'", "R2", "U", "U'", "U2"}, alg = new String[11];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}
}else if(cat.equals("333")||cat.equals("3Bf")||cat.equals("3OH")||cat.equals("3FM")||cat.equals("3Ft")||cat.equals("3MBf")){
if(!wca){
String[] move = {"F", "F'", "F2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "B", "B'", "B2", "M", "M'", "M2", "S", "S'", "S2", "E", "E'", "E2", "x", "x'", "x2", "y", "y'", "y2", "z", "z'", "z2", "f", "f'", "f2", "l", "l'", "l2", "r", "r'", "r2", "u", "u'", "u2", "d", "d'", "d2", "b", "b'", "b2"}, alg = new String[20];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0) == m.charAt(0)) m = move[int(random(move.length))];//avoid repetition of moves on the same layer/face
if(alg[i-1] == m || alg[i-1].charAt(0) == m.charAt(0)) m = move[int(random(move.length))];//double security
if(i>1){
if(alg[i-2].charAt(0) == 'F' && alg[i-2].charAt(0) == m.charAt(0) && (alg[i-1].charAt(0) == 'z' || alg[i-1].charAt(0) == 'B')){
if(alg[i-1].charAt(0) == 'z'){
String notF[] = {"B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "x", "x'", "x2", "y", "y'", "y2"};
m = notF[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'B'){
String notF[] = {"L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2"};
m = notF[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'B' && alg[i-2].charAt(0) == m.charAt(0) && (alg[i-1].charAt(0) == 'z' || alg[i-1].charAt(0) == 'F')){
if(alg[i-1].charAt(0) == 'z'){
String notB[] = {"F", "F'", "F2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "x", "x'", "x2", "y", "y'", "y2"};
m = notB[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'F'){
String notB[] = {"L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2"};
m = notB[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'L' && alg[i-2].charAt(0) == m.charAt(0) && (alg[i-1].charAt(0) == 'x' || alg[i-1].charAt(0) == 'R')){
if(alg[i-1].charAt(0) == 'x'){
String notL[] = {"F", "F'", "F2", "B", "B'", "B2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "y", "y'", "y2"};
m = notL[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'R'){
String notL[] = {"F", "F'", "F2", "B", "B'", "B2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2"};
m = notL[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'R' && alg[i-2].charAt(0) == m.charAt(0) && (alg[i-1].charAt(0) == 'x' || alg[i-1].charAt(0) == 'L')){
if(alg[i-1].charAt(0) == 'x'){
String notR[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "y", "y'", "y2"};
m = notR[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'L'){
String notR[] = {"F", "F'", "F2", "B", "B'", "B2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2"};
m = notR[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'U' && alg[i-2].charAt(0) == m.charAt(0) && (alg[i-1].charAt(0) == 'y' || alg[i-1].charAt(0) == 'D')){
if(alg[i-1].charAt(0) == 'y'){
String notU[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2"};
m = notU[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'D'){
String[] notU = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2"};
m = notU[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'D' && alg[i-2].charAt(0) == m.charAt(0) && (alg[i-1].charAt(0) == 'y' || alg[i-1].charAt(0) == 'U')){
if(alg[i-1].charAt(0) == 'y'){
String notD[] = {"U", "U'", "U2", "F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "z", "z'", "z2", "x", "x'", "x2"};
m = notD[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'U'){
String notD[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2"};
m = notD[int(random(move.length))];
}
}
}
}
alg[i] = m;
}
algo = join(alg, " ");
}else{
String[] move = {"F", "F'", "F2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "B", "B'", "B2"}, alg = new String[20];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0) == m.charAt(0)) m = move[int(random(move.length))];//avoid repetition of moves on the same layer/face
if(alg[i-1] == m || alg[i-1].charAt(0) == m.charAt(0)) m = move[int(random(move.length))];//double security
if(i>1){
if(alg[i-2].charAt(0) == 'F' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'B'){
String notF[] = {"L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2"};
m = notF[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'B' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'F'){
String notB[] = {"L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2"};
m = notB[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'L' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'R'){
String notL[] = {"F", "F'", "F2", "B", "B'", "B2", "U", "U'", "U2", "D", "D'", "D2"};
m = notL[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'R' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'L'){
String notR[] = {"F", "F'", "F2", "B", "B'", "B2", "U", "U'", "U2", "D", "D'", "D2"};
m = notR[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'U' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'D'){
String[] notU = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2"};
m = notU[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'D' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'U'){
String notD[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2"};
m = notD[int(random(move.length))];
}
}
}
alg[i] = m;
}
algo = join(alg, " ");
}
}else if(cat.equals("444")||cat.equals("4Bf")||cat.equals("4OH")||cat.equals("4FM")||cat.equals("4Ft")||cat.equals("4MBf")){
if(!wca){
String[] move = {"F", "F'", "F2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "B", "B'", "B2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2", "f", "f'", "f2", "b", "b'", "b2", "l", "l'", "l2", "r", "r'", "r2", "u", "u'", "u2", "d", "d'", "d2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"}, alg = new String[40];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0) == m.charAt(0)) m = move[int(random(move.length))];//double security
if(i>1){
if(alg[i-2].charAt(0) == 'F' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'B'){
if(alg[i-1].charAt(0) == 'z'){
String notF[] = {"B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "x", "x'", "x2", "y", "y'", "y2", "b", "b'", "b2", "l", "l'", "l2", "r", "r'", "r2", "u", "u'", "u2", "d", "d'", "d2", "Bw", "Bw'", "Bw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notF[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'B'){
String notF[] = {"L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2", "l", "l'", "l2", "r", "r'", "r2", "u", "u'", "u2", "d", "d'", "d2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notF[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'B' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'F'){
if(alg[i-1].charAt(0) == 'z'){
String notB[] = {"F", "F'", "F2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "x", "x'", "x2", "y", "y'", "y2", "f", "f'", "f2", "l", "l'", "l2", "r", "r'", "r2", "u", "u'", "u2", "d", "d'", "d2", "Fw", "Fw'", "Fw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notB[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'F'){
String notB[] = {"L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2", "l", "l'", "l2", "r", "r'", "r2", "u", "u'", "u2", "d", "d'", "d2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notB[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'L' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'R'){
if(alg[i-1].charAt(0) == 'x'){
String notL[] = {"F", "F'", "F2", "B", "B'", "B2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "y", "y'", "y2", "f", "f'", "f2", "b", "b'", "b2", "r", "r'", "r2", "u", "u'", "u2", "d", "d'", "d2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notL[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'R'){
String notL[] = {"F", "F'", "F2", "B", "B'", "B2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2", "f", "f'", "f2", "b", "b'", "b2", "u", "u'", "u2", "d", "d'", "d2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notL[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'R' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'L'){
if(alg[i-1].charAt(0) == 'x'){
String notR[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "y", "y'", "y2", "f", "f'", "f2", "b", "b'", "b2", "l", "l'", "l2", "u", "u'", "u2", "d", "d'", "d2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Lw", "Lw'", "Lw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notR[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'L'){
String notR[] = {"F", "F'", "F2", "B", "B'", "B2", "U", "U'", "U2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2", "f", "f'", "f2", "b", "b'", "b2", "u", "u'", "u2", "d", "d'", "d2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notR[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'U' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'D'){
if(alg[i-1].charAt(0) == 'y'){
String notU[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "D", "D'", "D2", "z", "z'", "z2", "x", "x'", "x2", "f", "f'", "f2", "b", "b'", "b2", "l", "l'", "l2", "r", "r'", "r2", "d", "d'", "d2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Dw", "Dw'", "Dw2"};
m = notU[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'D'){
String notU[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2", "f", "f'", "f2", "b", "b'", "b2", "l", "l'", "l2", "r", "r'", "r2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2"};
m = notU[int(random(move.length))];
}
}
if(alg[i-2].charAt(0) == 'D' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'U'){
if(alg[i-1].charAt(0) == 'y'){
String notD[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "z", "z'", "z2", "x", "x'", "x2", "f", "f'", "f2", "b", "b'", "b2", "l", "l'", "l2", "r", "r'", "r2", "d", "d'", "d2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Dw", "Dw'", "Dw2"};
m = notD[int(random(move.length))];
}else if(alg[i-1].charAt(0) == 'U'){
String notD[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "z", "z'", "z2", "x", "x'", "x2", "y", "y'", "y2", "f", "f'", "f2", "b", "b'", "b2", "l", "l'", "l2", "r", "r'", "r2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2"};
m = notD[int(random(move.length))];
}
}
}
}
alg[i] = m;
if(i>0 && i%26==0) alg[i] += "\n";
}
algo = join(alg, " ");
}else{
String[] move = {"F", "F'", "F2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "B", "B'", "B2", "Fw", "Fw'", "Fw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2", "Bw", "Bw'", "Bw2"}, alg = new String[40];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0) == m.charAt(0)) m = move[int(random(move.length))];//double security
if(i>1){
if(alg[i-2].charAt(0) == 'F' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'B'){
String notF[] = {"L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notF[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'B' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'F'){
String notB[] = {"L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notB[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'L' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'R'){
String notL[] = {"F", "F'", "F2", "B", "B'", "B2", "U", "U'", "U2", "D", "D'", "D2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notL[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'R' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'L'){
String notR[] = {"F", "F'", "F2", "B", "B'", "B2", "U", "U'", "U2", "D", "D'", "D2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notR[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'U' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'D'){
String[] notU = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2"};
m = notU[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'D' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'U'){
String notD[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2"};
m = notD[int(random(move.length))];
}
}
}
alg[i] = m;
if(i>0 && i%26==0) alg[i] += "\n";
}
algo = join(alg, " ");
}
}else if(cat.equals("555")||cat.equals("5Bf")||cat.equals("5Ft")){
if(!wca){
String[] move = {"F", "F'", "F2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "B", "B'", "B2", "M", "M'", "M2", "S", "S'", "S2", "E","E'", "E2", "x", "x'", "x2", "y", "y'", "y2", "z", "z'", "z2", "f", "f'", "f2", "l", "l'", "l2", "r", "r'", "r2", "u", "u'", "u2", "d", "d'", "d2", "b", "b'", "b2", "Fw", "Fw'", "Fw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2", "Bw", "Bw'", "Bw2"}, alg = new String[60];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else{
String[] move = {"F", "F'", "F2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "B", "B'", "B2", "Fw", "Fw'", "Fw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2", "Bw", "Bw'", "Bw2"}, alg = new String[60];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0) == m.charAt(0)) m = move[int(random(move.length))];//double security
if(i>1){
if(alg[i-2].charAt(0) == 'F' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'B'){
String notF[] = {"L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notF[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'B' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'F'){
String notB[] = {"L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notB[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'L' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'R'){
String notL[] = {"F", "F'", "F2", "B", "B'", "B2", "U", "U'", "U2", "D", "D'", "D2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notL[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'R' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'L'){
String notR[] = {"F", "F'", "F2", "B", "B'", "B2", "U", "U'", "U2", "D", "D'", "D2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2"};
m = notR[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'U' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'D'){
String[] notU = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2"};
m = notU[int(random(move.length))];
}
if(alg[i-2].charAt(0) == 'D' && alg[i-2].charAt(0) == m.charAt(0) && alg[i-1].charAt(0) == 'U'){
String notD[] = {"F", "F'", "F2", "B", "B'", "B2", "L", "L'", "L2", "R", "R'", "R2", "Fw", "Fw'", "Fw2", "Bw", "Bw'", "Bw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2"};
m = notD[int(random(move.length))];
}
}
}
alg[i] = m;
}
algo = join(alg, " ");
}
}else if(cat.equals("666")){
String[] move = {"F", "F'", "F2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "B", "B'", "B2", "x", "x'", "x2", "y", "y'", "y2", "z", "z'", "z2", "2F", "2F'", "2F2", "2L", "2L'", "2L2", "2R", "2R'", "2R2", "2U", "2U'", "2U2", "2D", "2D'", "2D2", "2B", "2B'", "2B2", "Fw", "Fw'", "Fw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2", "Bw", "Bw'", "Bw2", "3F", "3F'", "3F2", "3L", "3L'", "3L2", "3R", "3R'", "3R2", "3U", "3U'", "3U2", "3D", "3D'", "3D2", "3B", "3B'", "3B2", "fw", "fw'", "fw2", "lw", "lw'", "lw2", "Rw", "Rw'", "Rw2", "uw", "uw'", "uw2", "dw", "dw'", "dw2", "bw", "bw'", "bw2"}, alg = new String[100];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else if(cat.equals("777")){
String[] move = {"F", "F'", "F2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "B", "B'", "B2", "M", "M'", "M2", "S", "S'", "S2", "E","E'", "E2", "x", "x'", "x2", "y", "y'", "y2", "z", "z'", "z2", "2F", "2F'", "2F2", "2L", "2L'", "2L2", "2R", "2R'", "2R2", "2U", "2U'", "2U2", "2D", "2D'", "2D2", "2B", "2B'", "2B2", "Fw", "Fw'", "Fw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2", "Bw", "Bw'", "Bw2", "3F", "3F'", "3F2", "3L", "3L'", "3L2", "3R", "3R'", "3R2", "3U", "3U'", "3U2", "3D", "3D'", "3D2", "3B", "3B'", "3B2", "fw", "fw'", "fw2", "lw", "lw'", "lw2", "Rw", "Rw'", "Rw2", "uw", "uw'", "uw2", "dw", "dw'", "dw2", "bw", "bw'", "bw2"}, alg = new String[120];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else if(cat.equals("888")){
String[] move = {"F", "F'", "F2", "L", "L'", "L2", "R", "R'", "R2", "U", "U'", "U2", "D", "D'", "D2", "B", "B'", "B2", "M", "M'", "M2", "S", "S'", "S2", "E","E'", "E2", "x", "x'", "x2", "y", "y'", "y2", "z", "z'", "z2", "2F", "2F'", "2F2", "2L", "2L'", "2L2", "2R", "2R'", "2R2", "2U", "2U'", "2U2", "2D", "2D'", "2D2", "2B", "2B'", "2B2", "Fw", "Fw'", "Fw2", "Lw", "Lw'", "Lw2", "Rw", "Rw'", "Rw2", "Uw", "Uw'", "Uw2", "Dw", "Dw'", "Dw2", "Bw", "Bw'", "Bw2", "3F", "3F'", "3F2", "3L", "3L'", "3L2", "3R", "3R'", "3R2", "3U", "3U'", "3U2", "3D", "3D'", "3D2", "3B", "3B'", "3B2", "fw", "fw'", "fw2", "lw", "lw'", "lw2", "Rw", "Rw'", "Rw2", "uw", "uw'", "uw2", "dw", "dw'", "dw2", "bw", "bw'", "bw2"}, alg = new String[140];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else if(cat.equals("Meg")){
if(!wca){
String[] move = {"R++", "R--", "D++", "D--", "U", "U'"}, alg = new String[77];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
if(i>0 && i%20==0) alg[i] += "\n";
}
algo = join(alg, " ");
}else{
String[] Bd = {"++", "--"}, d = {"", "'"}, alg = new String[7];
for(int i=0; i<alg.length; i++){
alg[i] = "R"+Bd[int(random(Bd.length))]+" D"+Bd[int(random(Bd.length))]+" R"+Bd[int(random(Bd.length))]+" D"+Bd[int(random(Bd.length))]+" R"+Bd[int(random(Bd.length))]+" D"+Bd[int(random(Bd.length))]+" R"+Bd[int(random(Bd.length))]+" D"+Bd[int(random(Bd.length))]+" R"+Bd[int(random(Bd.length))]+" D"+Bd[int(random(Bd.length))]+" U"+d[int(random(d.length))];
alg[i] += "\n";
}
algo = join(alg, " ");
}
}else if(cat.equals("Gig")){
String[] move = {"R++", "R--", "D++", "D--", "U", "U'", "Rw++", "Rw--", "Dw++", "Dw--", "Uw", "Uw'"}, alg = new String[144];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else if(cat.equals("Pet")){
String[] move = {"R++", "R--", "D++", "D--", "U", "U'", "Rw++", "Rw--", "Dw++", "Dw--", "Uw", "Uw'", "rw++", "rw--", "dw++", "dw--", "u", "u'"}, alg = new String[200];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else if(cat.equals("Ter")){
String[] move = {"R++", "R--", "D++", "D--", "U", "U'", "r++", "r--", "d++", "d--", "u", "u'", "Rw++", "Rw--", "Dw++", "Dw--", "Uw", "Uw'", "rw++", "rw--", "dw++", "dw--", "u", "u'"}, alg = new String[244];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else if(cat.equals("Tutt")){
String[] move = {"F", "F'", "F2", "F2'", "L", "L'", "L2", "L2'", "R", "R'", "R2", "R2'", "U", "U'", "U2", "U2'", "D", "D'", "D2", "D2'", "B", "B'", "B2", "B2'", "x", "x'", "x2", "x2'", "y", "y'", "y2", "y2'", "z", "z'", "z2", "z2'"}, alg = new String[300];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else if(cat.equals("2Pyr")){
String[] move = {"F", "F'", "L", "L'", "R", "R'", "U", "U'", "D", "D'", "B", "B'", "x", "x'", "y", "y'", "z", "z'"}, alg = new String[5];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else if(cat.equals("Pyr")){
if(!wca){
String[] move = {"F", "F'", "L", "L'", "R", "R'", "U", "U'", "D", "D'", "B", "B'", "x", "x'", "y", "y'", "z", "z'", "u", "u'", "l", "l'", "r", "r'", "b", "b'"}, alg = new String[11];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else{
String[] move = {"F", "F'", "L", "L'", "R", "R'", "U", "U'", "D", "D'", "B", "B'"}, vMv = {"u", "u'", "l", "l'", "r", "r'", "b", "b'"}, alg = new String[11];
for(int i=0; i<8; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
alg[8] = vMv[int(random(vMv.length))];
alg[9] = vMv[int(random(vMv.length))];
alg[10] = vMv[int(random(vMv.length))];
algo = join(alg, " ");
}
}else if(cat.equals("4Pyr")){
String[] move = {"F", "F'", "L", "L'", "R", "R'", "U", "U'", "D", "D'", "B", "B'", "x", "x'", "y", "y'", "z", "z'", "u", "u'", "l", "l'", "r", "r'", "b", "b'", "E", "E'", "S", "S'", "Ml", "Ml'", "Mr", "Mr'"}, alg = new String[22];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else if(cat.equals("5Pyr")){
String[] move = {"F", "F'", "L", "L'", "R", "R'", "U", "U'", "D", "D'", "B", "B'", "x", "x'", "y", "y'", "z", "z'", "u", "u'", "l", "l'", "r", "r'", "b", "b'", "Eu", "Eu'", "Ed", "Ed'", "Sf", "Sf'", "Sb", "Sb'", "Ml", "Ml'", "Mr", "Mr'"}, alg = new String[44];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else if(cat.equals("Sq1")){
String[] move = {"0", "1", "2", "3", "4", "5", "6", "-1", "-2", "-3", "-4", "-5", "-6"}, alg = new String[12];
for(int i=0; i<alg.length; i++){
String m = "("+move[int(random(move.length))]+", "+move[int(random(move.length))]+")";
if(i<11) m += " /";
if(i>0 && alg[i-1] == m){
m = move[int(random(move.length))];
if(alg[i-1] == m) m = move[int(random(move.length))];
}
alg[i] = m;
if(i>0 && i%10==0) alg[i] += "\n";
}
algo = join(alg, " ");
}else if(cat.equals("Sq2")){
String[] move = {"0", "1", "2", "3", "4", "5", "6", "-1", "-2", "-3", "-4", "-5", "-6"}, alg = new String[18];
for(int i=0; i<alg.length; i++){
String m = "("+move[int(random(move.length))]+", "+move[int(random(move.length))]+")";
if(i<11) m += " /";
if(i>0 && alg[i-1] == m){
m = move[int(random(move.length))];
if(alg[i-1] == m) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else if(cat.equals("Sq3")){
String[] move = {"0", "1", "2", "3", "4", "5", "6", "-1", "-2", "-3", "-4", "-5", "-6"}, slash = {"/", "\\"}, alg = new String[24];
for(int i=0; i<alg.length; i++){
String m = "("+move[int(random(move.length))]+", "+move[int(random(move.length))]+")";
if(i<11) m += " "+slash[int(random(slash.length))];
if(i>0 && alg[i-1] == m){
m = move[int(random(move.length))];
if(alg[i-1] == m) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else if(cat.equals("Clock")){
String[] move = {"0", "1", "2", "3", "4", "5", "6", "-1", "-2", "-3", "-4", "-5", "-6"};//, pin = {"UU", "dU", "dd", "Ud"};
algo = "[UU/dd] "+move[int(random(move.length))]+"/"+move[int(random(move.length))]+" [dU/dU] "+move[int(random(move.length))]+"/"+move[int(random(move.length))]+" [dd/UU] "+move[int(random(move.length))]+"/"+move[int(random(move.length))]
+" [Ud/Ud] "+move[int(random(move.length))]+"/"+move[int(random(move.length))]+" [dU/UU] "+move[int(random(move.length))]+"/"+move[int(random(move.length))]+" [Ud/UU] "+move[int(random(move.length))]+"/"+move[int(random(move.length))]
+" [UU/Ud] "+move[int(random(move.length))]+"/"+move[int(random(move.length))]+" [UU/dU] "+move[int(random(move.length))]+"/"+move[int(random(move.length))]+" [UU/UU] "+move[int(random(move.length))]+"/"+move[int(random(move.length))]
+" [dd/dd] "+move[int(random(move.length))]+"/"+move[int(random(move.length))]+" [dU/UU] "+move[int(random(move.length))]+"/"+move[int(random(move.length))];
}else if(cat.equals("Skewb")){
if(!wca){
String[] move = {"F", "F'", "L", "L'", "R", "R'", "U", "U'", "D", "D'", "C", "C'", "x", "x'", "x2", "y", "y'", "y2", "z", "z'", "z2"}, alg = new String[9];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else{
String[] move = {"F", "F'", "L", "L'", "R", "R'", "U", "U'", "D", "D'"}, alg = new String[9];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}
}else if(cat.equals("Copter")){
if(!wca){//not WCA valid and without jumbling
String[] move = {"F", "f", "FL", "FR", "B", "b", "BL", "BR", "L", "l", "R", "r", "x", "x'", "x2", "y", "y'", "y2", "z", "z'", "z2"}, alg = new String[13];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}else{//not WCA valid and with jumbling
String[] move = {"F", "f", "FL", "FR", "B", "b", "BL", "BR", "L", "l", "R", "r", "JR", "Jr", "JL", "Jl"}, alg = new String[17];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
algo = join(alg, " ");
}
}
println(cat+": "+algo);
return algo;
}
String subsetScramble(String cat, String[] mvs){//mvs=[U, R]
println("cat="+cat+" <"+mvs.toString()+">");
if(cat.equals("2G")||cat.equals("2Gen")||cat.equals("2 Generator")){
String[] move = {mvs[0], mvs[0]+"\'", mvs[0]+"2", mvs[1], mvs[1]+"\'", mvs[1]+"2"}, alg = new String[19];//mvs=[U, U', U2, R, R', R2]
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
return join(alg, " ");
}else if(cat.equals("3G")||cat.equals("3Gen")||cat.equals("3 Generator")){
String[] move = {mvs[0], mvs[0]+"\'", mvs[0]+"2", mvs[1], mvs[1]+"\'", mvs[1]+"2", mvs[2], mvs[2]+"\'", mvs[2]+"2"}, alg = new String[19];//mvs=[U, U', U2, R, R', R2, F, F', F2]
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
return join(alg, " ");
}else if(cat.equals("2G+")||cat.equals("2Gen+")||cat.equals("2 Generator +")){
String[] move = {mvs[0], mvs[0]+"\'", mvs[0]+"2", mvs[1], mvs[1]+"\'", mvs[1]+"2", mvs[1].toLowerCase(), mvs[2].toLowerCase()+"\'", mvs[2].toLowerCase()+"2"}, alg = new String[19];//mvs=[U, U', U2, R, R', R2, r, r', r2]
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
return join(alg, " ");
}/*else if(cat.equals("PLL")||cat.equals("pll")||cat.equals("LLP")){
String[] pll = {//U
"R U' R U R U R U' R' U' R2",
"R2' U R U R' U' R' U' R' U R'",
"R2' U' R' U' R U R U R U' R",
"R' U R' U' R' U' R' U R U R2",
"R2' U' F B' R2 F' B U' R2'",
"M2 U M U2 M' U M2",
"M2 U' M U2 M' U' M2",
"M2 U M' U2 M U M2",
//Z
"M2 U' M2 U' M' U2 M2 U2 M' U2",
"M2 U M2 U M' U2 M2 U2 M' U2",
//H
"M2 U M2 U2 M2 U M2",
//A
"l' U R' D2 R U' R' D2 R2",
"x' R2 D2 R' U' R D2 R' U R'",
"r' U L' D2 L U' L' D2 L2'",
"r U' L u2 R' U R u2' L2",
"x R2 D2 R U R' D2 R U' R'",
"l U' R D2 R' U R D2 R2",
//E
"x' R U' R' D R U R' D' R U R' D R U' R' D'",
//J
"R U R' F' R U R' U' R' F R2 U' R'",
"z R U R' D R2 U' R U R2' U' D'",
"R' U2' R U R' U2' z U R' D R U'",
"L' U' R' z R2 U R' U' R2 U D R'",
"L' U' L F L' U' L U L F' L2 U L",
//N
"R' U R U' R' F' U' F R U R' F R' F' R U' R",
"R U R' U R U R' F' R U R' U' R' F R2 U' R' U2 R U' R'",
//F
"R' U' F' R U R' U' R' F R2 U' R' U' R U R' U R",
"R' U2 R' U' d' R' F' R2 U' R' U R' F R U' F",
"F' U2 F' U' R' F' R2 U' R' U R' F R U' F",
"R' U R U' R2 F' U' F U R U' [R2 f' U' f] or [x' R2 U' R' U]",
//V
"R' U R' d' R' F' R2 U' R' U l' U R U",
"L' U2 L U2 R U' L' U R' U R U' L U R'",
//T
"R U R' U' R' F R2 U' R' U' R U R' F'",
"L' U' L U L F' L2 U L U L' U' L F",
//Y
"F R U' R' U' R U R' F' R U R' U' R' F R F'",
"L2' U' L' U L U' y r' U' R U' R' U' L U"
//R
"R' U2 R U2' R' F R U R' U' R' F' R2 U'",
"L U2' L' U2' L F' L' U' L U L F L2' U",
"R U' R' U' R U R D R' U' R D' R' U2 R' U'",
//G
"R2 u R' U R' U' R u' R2 y' R' U R",
"z U2 r U' R U' R' U r' U2 x U' R U",
"F' U' F R2 u R' U R U' R u' R2'",
"R' d' F R2 u R' U R U' R u' R2'",
"R2' F2 R U2 R U2' R' F R U R' U' R' F R2",
"R2' u' R U' R U R' u R2 B U' B'",
"R2' F' R U R U' R' F' R U2' R' U2' R' F2 R2",
"R U R' U' D R2 U' R U' R' U R' U R2 U D'",
"f R f' R2 u' R U' R' U R' u R2"};
return pll[int(random(pll.length))];
}else if(cat.equals("OLL")||cat.equals("oll")||cat.equals("LLO")){
String[] oll = {//COLL (2nd LOLL)
"R U R' U R U2 R'", "R U2 R' U' R U' R'",
"R U2' R2' U' R2 U' R2' U2 R", "y R' U' R U' R' U R U' R' U2 R",
"r U R' U' r' F R F'", "F' r U R' U' r' F R",
"R2 D R' U2 R D' R' U2 R'",
//EOLL
"R U R' U' M' U R U' r'", "M' U M U2 M' U M",
"M U R U R' U' M2 U R U' r'",
//P
"f R U R' U' f'", "f' L' U' L U f",
"R U B' U' R' U R B R'", "R' U' F U R U' R' F' R",
//W
"R U R' U R U' R' U' R' F R F'", "L' U' L U' L' U L U L F' L' F",
//Squares
"r U2 R' U' R U' r'", "r' U2 R U R' U r",
//L
"F R U R' U' R U R' U' F'", "F' L' U' L U L' U' L U F",
"l' U' L U' L' U L U' L' U2 l'", "r U R' U R U' R' U R U2 r'",
"R' F R' F' R2 U2 y R' F R F'", "R' F R2 B' R2 F' R2 B R'",
//Fish
"R' U' R y' x' R U' R' F R U R'", "R U R' y R' F R U' R' F' R",
"R U2 R2' R' F R F' R U2 R'", "F R U' R' U' R U R' F'",
//Awkward
"R2 U R' B' R U' R2 U R B R'", "R U R' U' R U' R' F' U' F R U R'",
"R U R' U R U2 R' F R U R' U' F'", "R' U2 R U R' U R y F R U R' U' F'",
//Lightning Bolts
"r U R' U R U2 r'", "r' U' R U' R' U2 r",
"F' L' U' L U F y F R U R' U' F'", "F R U R' U' F' U F'",
"R B' R' U' R U B U' R'", "R' F R U R' U' F' U R"
//T
"F R U R' U' F'", "R U R' U' R' F R F'",
//C
"R' U' R' F R F' U R", "R U R2 U' R' F R U R U' F'",
//I
"R' U2 R2 U R' U R U2 x' U' R' U", "R U R' U R d' R U' R' F'",
"F R U R' U' R F' r U R' U' r'", "f R U R' U' R U R' U' f'",
//Knight Move
"r U M U R' U' r U' r'", "l' U' M U' L U l' U l",
"F U R U' R2 F' R U R U' R'", "R' F R U R' F' R y' R U' R'",
//No Edges
"R U2 R' R' F R F' U2 R' F R F'", "F R U R' U' S R U R' U' f'",
"f R U R' U' f' U' F R U R' U' F'", "f R U R' U' f' U F R U R' U' F'",
"F R U R' U F' y' U2 R' F R F'", "M U R U R' U' M' R' F R F'",
"R U R' U R' F R F' U2 R' F R F'"
};
return oll[int(random(oll.length))];
}*/else if(cat.equals("ELL")||cat.equals("ell")||cat.equals("LLE")){
String[] ell = {//EPLLs
"R U' R U R U R U' R' U' R2", "R2 U R U R' U' R' U' R' U R'", "M2 U M2 U M' U2 M2 U2 M'", "M2 U M2 U2 M2 U M2",
//EOLL
"y M2 U M U2 M' U M M' U M' U2 M U M'", "M' U M' U M' U M' U' M' U M' U M' U M'", "M' U M' U M' U M' U2 M' U M' U M' U M'",
//ELL
"y' r' U' R U M' U' R' U R", "y' M' U' M U2 M' U' M", "M U M' U' M' U' M' U M' U M U' M2", "y M' U M2 U M U2 M' U M'", "M' U M U2 M' U M", "y2 r U R' U' M U R U' R'", "y2 M' U' M2 U' M U2 M' U' M'", "y M U' M' U M' U M' U' M' U' M U M2", "y2 F R U R' U' F2 L' U' L U F", "M' U M U M' U2 M U' M' U' M", "y M' U M U M' U M U M' U M",
"R U R' U' M' U R U' r'", "M2 U' M U M' U M' U' M' U' M' U M", "R' U' R U M U' R' U r", "M2 U M U' M' U' M' U M' U M' U' M", "M' U' M U M' U' M U' M' U2 M", "M' U' M U M' U' M U' M' U2 M", "M' U M2 U2 M' U M' U2 M' U' M U' M",
"M' U M U2 M' U M2 U' M' U2 M U' M'", "r U R' U' M2 U R U' R' U' M'", "M' U' M U' M' U2 M' U' M' U' M U' M' U' M'", "M' U M U M' U2 M' U M' U M U M' U M'"
};
return ell[int(random(ell.length))];
}else if(cat.equals("CLL")||cat.equals("cll")||cat.equals("LLC")){
String[] cll = {"y U' R U R' U R U2 R'", "y R U2 R' U' R U' R'", "y U R U R' U L' U R U' L U2 R'", "y U R' U' R U' L U' R' U L' U2 R", "y U' R U' L' U R' U' L", "y U L' U R U' L U R'", "y U' L' R U R' U' L U2 R U2 R'", "y U R2 D R' U2 R D' R2 U' R U' R'", "y U R U R' U R2 D R' U2 R D' R2", "y U R U2 R' U2 L' U R U' R' L", "y U R2 D' R U' R' D R U' R U R' U R", "y R' U' R U' R' U R' D' R U R' D R2",
"R U R' U R U' R' U R U2 R'", "(U) F (R U R' U')3 F'", "F R U' R' U R U2 R' U' R U R' U' F'", "R U R' U R U L' U R' U' L", "(U2) F RU'R'U R U2 R' U' R U R' U' F'", "(U2) R U R' U R U L' U R' U' L",
"R' U' R U' R' U2 R2 U R' U R U2 R'", "R U2 R2 U' R2 U' R2 U2 R", "R' U2 x R U' R' U B2 U' R U x'", "R U D' R U R' D R2 U' R' U' R2' U2' R", "(U2) R2 D R' U2 R D' R' U2 R'", "R' F2 R U2 R U2 R' F2 U' R U' R'", "R2 D' R U2 R' D R U2 R", "(U') R' U2 R U R' U R2 U' L' U R' U' L", "(U') R' U' R F R2 D' R U R' D R2 U' F'", "R U' L' U R' U L U L' U L", "R' U2 R F U' R' U' R U F'", "(U) F R2 U' R2' U R2 U y L' R U2 R'",
"R U' L' U R' U' R U R' U' L U R U' R'", "(U') R U R'U R U2 R' U' R U2 R'U'R U' R'", "(U) L' U2 R U' R' U2 L R U' R'", "(U2) F R U R' U' R U' R' U' R U R' F'", "(U') R U2 R D R' U2 R D' R2", "R' U R U2 L' R' U R U' L", "(U2) R' U2 R' D' R U2 R' D R2", "R' U R2 D r' U2 r D' R2 U' R", "(U') x U R' U' L U R U' r'", "(U) l' U' L U R U' L' U x'", "x U' L U R' U' L' U l", "(U') r U R' U' L' U R U' x'"
};
return cll[int(random(cll.length))];
}else if(cat.equals("ZBLL")||cat.equals("zbll")){
String[] zbll = {//
};
return zbll[int(random(zbll.length))];
}else if(cat.equals("LSLL")||cat.equals("lsll")||cat.equals("ZBF2L")||cat.equals("MGLS")||cat.equals("VHLS")||cat.equals("WVLS")||cat.equals("SVLS")){
String[] lsll = {//
};
return lsll[int(random(lsll.length))];
}else if(cat.equals("HalfMovesOnly")||cat.equals("FaceMoves")||cat.equals("180deg moves")||cat.equals("double moves")){
String[] move = {"U2", "F2", "R2", "D2", "B2", "L2"}, alg = new String[19];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
return join(alg, " ");
}else if(cat.equals("QuarterMovesOnly")||cat.equals("QuarterMoves")||cat.equals("90deg moves")||cat.equals("simple moves")){
String[] move = {"U", "U'", "F", "F'", "R", "R'", "D", "D'", "B", "B'", "L", "L'"}, alg = new String[19];
for(int i=0; i<alg.length; i++){
String m = move[int(random(move.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = move[int(random(move.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = move[int(random(move.length))];
}
alg[i] = m;
}
return join(alg, " ");
}else if(cat.equals("Edges")||cat.equals("edge")||cat.equals("EdgeOnly")||cat.equals("EAL")){
String[] eal = {
};
return eal[int(random(eal.length))];
}else if(cat.equals("Corners")||cat.equals("corner")||cat.equals("CornerOnly")||cat.equals("CAL")){
String[] cal = {
};
return cal[int(random(cal.length))];
}/*else if(cat.equals("F2L")||cat.equals("f2l")){
String[] f2l = {"U R U' R'", "R' F R F'", "y' U' R' U R y", "F R' F' R", "y' R' U' R y", "R U R'",
"U' R U R' U2 R U' R'", "d R' U' R U2' R' U R d'", "U' R U2' R' U2 R U' R'", "d R' U2 R U2' R' U R d'",
"d R' U' R U' R' U' R d'", "U' R U R' U R U R'", "U' R U2' R' d R' U' R d'", "d R' U2 R d' R U R'", "d R' U R U' R' U' R d'", "U' R U' R' U R U R'"
"y' R' U R U' d' R U R' d' y", "R U' R' U d R' U' R d'", "R U2 R' U' R U R'", "y' R' U2 R U R' U' R",
"U R U2 R' U R U' R'", "y' U' R' U2 R U' R' U R y", "U2 R U R' U R U' R'", "y' U2 R' U' R U' R' U R y",
"U2 R2 U2 R' U' R U' R2", "y' U2 R2 U2 R U R' U R2 y",
"d' L' U L d R U' R'", "U R U' R' d' L' U L d", "R U' R' U R U' R'", "R U' R' U2 F' U F", "y' R' U' R U R' U' R y", "R U R' U' R U R'",
"R U' R' U F' U F", "R U R' U' R U R' U' R U R'", "U' R U' R' U2 R U' R'", "U' R U2' R' U R U R'", "U2 R U' R' U' F' U' F", "d R' U' R d' R U R'";
"R U R' U2 R U2 R' d R' U' R d'", "R U' R' U' R U R' U2 R U' R'", "R U' R' U R U2' R' U R U' R'", "y L' U' L U L' U L U2 F U F' y'", "R U R' U' R U' R' U2 F' U' F"
};
for(int i=0; i<4; i++){
String m = f2l[int(random(f2L.length))];
if(i>0 && (alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0))){
m = f2l[int(random(f2l.length))];
if(alg[i-1] == m || alg[i-1].charAt(0)==m.charAt(0)) m = f2l[int(random(f2l.length))];
}
alg[i] = m+" y";
}
return join(alg, " ");
}*/else if(cat.equals("EasyCross")||cat.equals("cross")){
String[] cross = {
};
return cross[int(random(cross.length))];
}else return "";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment