Skip to content

Commit

Permalink
chore: regenerate JS files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed May 21, 2020
1 parent 65f9d3e commit a1bb4e4
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 44 deletions.
12 changes: 2 additions & 10 deletions docs/lib/async.js
@@ -1,5 +1,5 @@
(function() {
var Cube, Extend, Include, key, value;
var Cube, Extend, key, value;

Cube = this.Cube || require('./cube');

Expand Down Expand Up @@ -58,10 +58,7 @@
cmd: 'solve',
cube: Cube.random().toJSON()
});
}
};

Include = {
},
asyncSolve: function(callback) {
return Cube._asyncSolve(this, callback);
}
Expand All @@ -72,9 +69,4 @@
Cube[key] = value;
}

for (key in Include) {
value = Include[key];
Cube.prototype[key] = value;
}

}).call(this);
2 changes: 1 addition & 1 deletion docs/lib/cube.js
Expand Up @@ -218,7 +218,7 @@

static fromString(str) {
var col1, col2, cube, i, j, k, l, m, o, ori, p, q, r, ref;
cube = new Cube;
cube = new Cube();
for (i = k = 0; k <= 5; i = ++k) {
for (j = l = 0; l <= 5; j = ++l) {
if (str[9 * i + 4] === centerColor[j]) {
Expand Down
28 changes: 13 additions & 15 deletions docs/lib/solve.js
Expand Up @@ -285,7 +285,7 @@
// state in each iteration. Then apply each of the 18 moves to the
// cube, and compute the resulting coordinate.
apply = context === 'corners' ? 'cornerMultiply' : 'edgeMultiply';
cube = new Cube;
cube = new Cube();
results = [];
for (i = m = 0, ref = size - 1; (0 <= ref ? m <= ref : m >= ref); i = 0 <= ref ? ++m : --m) {
cube[coord](i);
Expand All @@ -309,8 +309,8 @@
// of phase 2.
mergeURtoDF = (function() {
var a, b;
a = new Cube;
b = new Cube;
a = new Cube();
b = new Cube();
return function(URtoUL, UBtoDF) {
var i, m;
// Collisions can be found because unset are set to -1
Expand Down Expand Up @@ -376,7 +376,7 @@
URtoDF: ['edges', N_URtoDF],
URtoUL: ['edges', N_URtoUL],
UBtoDF: ['edges', N_UBtoDF],
mergeURtoDF: []
mergeURtoDF: [] // handled specially
};

Cube.computeMoveTables = function(...tables) {
Expand Down Expand Up @@ -719,7 +719,7 @@

//# Phase 1

// Return the next valid phase 1 moves for this state
// Return the next valid phase 1 moves for this state
moves1() {
if (this.lastMove !== null) {
return nextMoves1[this.lastMove / 3 | 0];
Expand Down Expand Up @@ -755,7 +755,7 @@

//# Phase 2

// Return the next valid phase 2 moves for this state
// Return the next valid phase 2 moves for this state
moves2() {
if (this.lastMove !== null) {
return nextMoves2[this.lastMove / 3 | 0];
Expand Down Expand Up @@ -813,14 +813,14 @@
solution = null;
phase1search = function(state) {
var depth, m, ref, results;
depth = 0;
results = [];
for (depth = m = 1, ref = maxDepth; (1 <= ref ? m <= ref : m >= ref); depth = 1 <= ref ? ++m : --m) {
phase1(state, depth);
if (solution !== null) {
break;
} else {
results.push(void 0);
}
results.push(depth++);
}
return results;
};
Expand Down Expand Up @@ -863,8 +863,9 @@
phase2(state, depth);
if (solution !== null) {
break;
} else {
results.push(void 0);
}
results.push(depth++);
}
return results;
};
Expand Down Expand Up @@ -897,18 +898,15 @@
var m, ref, results;
results = [];
for (x = m = 0, ref = maxDepth + 1; (0 <= ref ? m <= ref : m >= ref); x = 0 <= ref ? ++m : --m) {
results.push(new State);
results.push(new State());
}
return results;
})();
state = freeStates.pop().init(this);
phase1search(state);
freeStates.push(state);
// Trim the trailing space
if (solution.length > 0) {
solution = solution.substring(0, solution.length - 1);
}
return solution;
// Trim the trailing space and return
return solution.trim();
};

faceNums = {
Expand Down
2 changes: 1 addition & 1 deletion docs/lib/worker.js
Expand Up @@ -19,7 +19,7 @@
return;
}
if (args.scramble) {
cube = new Cube;
cube = new Cube();
cube.move(args.scramble);
} else if (args.cube) {
cube = new Cube(args.cube);
Expand Down
2 changes: 1 addition & 1 deletion lib/cube.js
Expand Up @@ -218,7 +218,7 @@

static fromString(str) {
var col1, col2, cube, i, j, k, l, m, o, ori, p, q, r, ref;
cube = new Cube;
cube = new Cube();
for (i = k = 0; k <= 5; i = ++k) {
for (j = l = 0; l <= 5; j = ++l) {
if (str[9 * i + 4] === centerColor[j]) {
Expand Down
28 changes: 13 additions & 15 deletions lib/solve.js
Expand Up @@ -285,7 +285,7 @@
// state in each iteration. Then apply each of the 18 moves to the
// cube, and compute the resulting coordinate.
apply = context === 'corners' ? 'cornerMultiply' : 'edgeMultiply';
cube = new Cube;
cube = new Cube();
results = [];
for (i = m = 0, ref = size - 1; (0 <= ref ? m <= ref : m >= ref); i = 0 <= ref ? ++m : --m) {
cube[coord](i);
Expand All @@ -309,8 +309,8 @@
// of phase 2.
mergeURtoDF = (function() {
var a, b;
a = new Cube;
b = new Cube;
a = new Cube();
b = new Cube();
return function(URtoUL, UBtoDF) {
var i, m;
// Collisions can be found because unset are set to -1
Expand Down Expand Up @@ -376,7 +376,7 @@
URtoDF: ['edges', N_URtoDF],
URtoUL: ['edges', N_URtoUL],
UBtoDF: ['edges', N_UBtoDF],
mergeURtoDF: []
mergeURtoDF: [] // handled specially
};

Cube.computeMoveTables = function(...tables) {
Expand Down Expand Up @@ -719,7 +719,7 @@

//# Phase 1

// Return the next valid phase 1 moves for this state
// Return the next valid phase 1 moves for this state
moves1() {
if (this.lastMove !== null) {
return nextMoves1[this.lastMove / 3 | 0];
Expand Down Expand Up @@ -755,7 +755,7 @@

//# Phase 2

// Return the next valid phase 2 moves for this state
// Return the next valid phase 2 moves for this state
moves2() {
if (this.lastMove !== null) {
return nextMoves2[this.lastMove / 3 | 0];
Expand Down Expand Up @@ -813,14 +813,14 @@
solution = null;
phase1search = function(state) {
var depth, m, ref, results;
depth = 0;
results = [];
for (depth = m = 1, ref = maxDepth; (1 <= ref ? m <= ref : m >= ref); depth = 1 <= ref ? ++m : --m) {
phase1(state, depth);
if (solution !== null) {
break;
} else {
results.push(void 0);
}
results.push(depth++);
}
return results;
};
Expand Down Expand Up @@ -863,8 +863,9 @@
phase2(state, depth);
if (solution !== null) {
break;
} else {
results.push(void 0);
}
results.push(depth++);
}
return results;
};
Expand Down Expand Up @@ -897,18 +898,15 @@
var m, ref, results;
results = [];
for (x = m = 0, ref = maxDepth + 1; (0 <= ref ? m <= ref : m >= ref); x = 0 <= ref ? ++m : --m) {
results.push(new State);
results.push(new State());
}
return results;
})();
state = freeStates.pop().init(this);
phase1search(state);
freeStates.push(state);
// Trim the trailing space
if (solution.length > 0) {
solution = solution.substring(0, solution.length - 1);
}
return solution;
// Trim the trailing space and return
return solution.trim();
};

faceNums = {
Expand Down
2 changes: 1 addition & 1 deletion lib/worker.js
Expand Up @@ -19,7 +19,7 @@
return;
}
if (args.scramble) {
cube = new Cube;
cube = new Cube();
cube.move(args.scramble);
} else if (args.cube) {
cube = new Cube(args.cube);
Expand Down

0 comments on commit a1bb4e4

Please sign in to comment.