Skip to content

Commit

Permalink
Added allowRandomU in algs - whether to consider incorrect final AUF …
Browse files Browse the repository at this point in the history
…to be solved
  • Loading branch information
Ashley Feniello authored and Ashley Feniello committed May 17, 2020
1 parent 4c2f50d commit f5b4726
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 20 deletions.
45 changes: 30 additions & 15 deletions algs.js
Expand Up @@ -26,7 +26,8 @@ var Algs = (function () {
solved: solvedPattern, // F2L+EO/CO+EP/CP
eo: false,
allowRandomM: false,
allowRandomM2: false
allowRandomM2: false,
allowRandomU: true
},
scramble: {
allowAuf: true,
Expand Down Expand Up @@ -57,7 +58,8 @@ var Algs = (function () {
solved: "UUUUUUUUU.L.LLLLLL.F.FFFFFF.R.RRRRRRDDDDDDDDDBBBBBB.B.", // F2L+EO/CO+EP
eo: false,
allowRandomM: false,
allowRandomM2: false
allowRandomM2: false,
allowRandomU: true
},
scramble: {
allowAuf: true,
Expand Down Expand Up @@ -88,7 +90,8 @@ var Algs = (function () {
solved: "UUUUUUUUU...LLLLLL...FFFFFF...RRRRRRDDDDDDDDDBBBBBB...", // F2L+EO/CO
eo: false,
allowRandomM: false,
allowRandomM2: false
allowRandomM2: false,
allowRandomU: true
},
scramble: {
allowAuf: true,
Expand Down Expand Up @@ -119,7 +122,8 @@ var Algs = (function () {
solved: ".U.UUU.U....LLLLLL...FFFFFF...RRRRRRDDDDDDDDDBBBBBB...", // F2L+EO
eo: false,
allowRandomM: false,
allowRandomM2: false
allowRandomM2: false,
allowRandomU: true
},
scramble: {
allowAuf: true,
Expand Down Expand Up @@ -150,7 +154,8 @@ var Algs = (function () {
solved: solvedCmllPattern, // F2B+CO/CP
eo: false,
allowRandomM: true,
allowRandomM2: true
allowRandomM2: true,
allowRandomU: true
},
scramble: {
allowAuf: true,
Expand Down Expand Up @@ -181,7 +186,8 @@ var Algs = (function () {
solved: partialCmllPattern, // F2B+CO (oriented considered solved)
eo: false,
allowRandomM: true,
allowRandomM2: true
allowRandomM2: true,
allowRandomU: true
},
scramble: {
allowAuf: true,
Expand Down Expand Up @@ -212,7 +218,8 @@ var Algs = (function () {
solved: solvedCmllPattern, // F2B+CO/CP
eo: false,
allowRandomM: true,
allowRandomM2: true
allowRandomM2: true,
allowRandomU: true
},
scramble: {
allowAuf: true,
Expand Down Expand Up @@ -243,7 +250,8 @@ var Algs = (function () {
solved: "U.U...U.UL.LLLLLLLF.FFFFFFFR.RRRRRRRDDDDDDDDDBBBBBBB.B", // F2L+CO/CP
eo: false,
allowRandomM: false,
allowRandomM2: false
allowRandomM2: false,
allowRandomU: true
},
scramble: {
allowAuf: true,
Expand Down Expand Up @@ -274,7 +282,8 @@ var Algs = (function () {
solved: "UUUUUUUUU...LLLLLL...FFFFFF...RRRRRRDDDDDDDDDBBBBBB...", // F2L+CO/EO
eo: false,
allowRandomM: false,
allowRandomM2: false
allowRandomM2: false,
allowRandomU: true
},
scramble: {
allowAuf: true,
Expand Down Expand Up @@ -305,7 +314,8 @@ var Algs = (function () {
solved: solvedPattern, // complete
eo: false,
allowRandomM: false,
allowRandomM2: false
allowRandomM2: false,
allowRandomU: true
},
scramble: {
allowAuf: true,
Expand Down Expand Up @@ -336,7 +346,8 @@ var Algs = (function () {
solved: solvedCmllPattern, // F2B+CO/CP
eo: true,
allowRandomM: false,
allowRandomM2: true
allowRandomM2: true,
allowRandomU: true
},
scramble: {
allowAuf: true,
Expand Down Expand Up @@ -367,7 +378,8 @@ var Algs = (function () {
solved: solvedPattern, // complete
eo: false,
allowRandomM: false,
allowRandomM2: false
allowRandomM2: false,
allowRandomU: true
},
scramble: {
allowAuf: false,
Expand Down Expand Up @@ -398,7 +410,8 @@ var Algs = (function () {
solved: solvedPattern, // complete
eo: false,
allowRandomM: false,
allowRandomM2: false
allowRandomM2: false,
allowRandomU: true
},
scramble: {
allowAuf: false,
Expand Down Expand Up @@ -429,7 +442,8 @@ var Algs = (function () {
solved: "............LLLLLL...FFFFFF...RRRRRRDDDDDDDDDBBBBBB...", // F2L
eo: false,
allowRandomM: false,
allowRandomM2: false
allowRandomM2: false,
allowRandomU: true
},
scramble: {
allowAuf: true,
Expand Down Expand Up @@ -460,7 +474,8 @@ var Algs = (function () {
solved: "............LLLLLL...F.FF.F...RRRRRRD.DD.DD.DB.BB.B...", // F2B
eo: false,
allowRandomM: true,
allowRandomM2: true
allowRandomM2: true,
allowRandomU: true
},
scramble: {
allowAuf: true,
Expand Down
12 changes: 7 additions & 5 deletions ui.js
Expand Up @@ -192,11 +192,13 @@
}
return true;
}
function matchWithAdjustments(pat, allowRandomM, allowRandomM2) {
function matchWithAdjustments(pat, allowRandomM, allowRandomM2, allowRandomU) {
if (Cube.matchPattern(pat, result)) return true;
if (Cube.matchPattern(pat, Cube.alg("U", result))) return true;
if (Cube.matchPattern(pat, Cube.alg("U'", result))) return true;
if (Cube.matchPattern(pat, Cube.alg("U2", result))) return true;
if (allowRandomU) {
if (Cube.matchPattern(pat, Cube.alg("U", result))) return true;
if (Cube.matchPattern(pat, Cube.alg("U'", result))) return true;
if (Cube.matchPattern(pat, Cube.alg("U2", result))) return true;
}
if (allowRandomM2 || allowRandomM) {
// try flipping up/down centers (maintaining edge orientation)
if (Cube.matchPattern(pat, Cube.alg("L2 R2", result))) return true;
Expand All @@ -218,7 +220,7 @@
}
var verify = Algs.kindToParams(kind).verify;
if (verify.eo && !checkEO()) return false;
return (verify.solved != undefined && matchWithAdjustments(verify.solved, verify.allowRandomM, verify.allowRandomM2));
return (verify.solved != undefined && matchWithAdjustments(verify.solved, verify.allowRandomM, verify.allowRandomM2, verify.allowRandomU));
}

function verify(result, includePartial) {
Expand Down

0 comments on commit f5b4726

Please sign in to comment.