Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion js/RubiksCube.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ function obfusticate(algorithm, numPremoves=3, minLength=16){
//Cube.initSolver();
var premoves = getPremoves(numPremoves);
var rc = new RubiksCube();

rc.doAlgorithm(alg.cube.invert(premoves) + algorithm);
orient = alg.cube.invert(rc.wcaOrient());
var solution = alg.cube.simplify(premoves + (alg.cube.invert(rc.solution())) + orient).replace(/2'/g, "2");
Expand Down Expand Up @@ -722,6 +723,15 @@ class AlgTest {
}
}

// Adds extra rotations to the end of an alg to reorient
function correctRotation(alg) {
var rc = new RubiksCube();
rc.doAlgorithm(alg);
var ori = rc.wcaOrient();

return alg + " " + ori;
}

function generateAlgTest(){

var set = document.getElementById("algsetpicker").value;
Expand All @@ -747,7 +757,7 @@ function generateAlgTest(){
solutions = rawAlgs;
}

var scramble = generateAlgScramble(solutions[0],set,obfusticateAlg,shouldPrescramble);
var scramble = generateAlgScramble(correctRotation(solutions[0]),set,obfusticateAlg,shouldPrescramble);
if (set == "F3L"){
solutions = [alg.cube.invert(scramble).replace(/2'/g, "2")];
}
Expand Down