Skip to content

Commit

Permalink
fix mathlib.CubieCUbe.verify
Browse files Browse the repository at this point in the history
  • Loading branch information
cs0x7f committed Jul 10, 2024
1 parent 22befb1 commit 11e601a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/js/lib/mathlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,11 @@ var mathlib = (function() {
CubieCube.prototype.verify = function() {
var mask = 0;
var sum = 0;
var ep = [];
for (var e = 0; e < 12; e++) {
mask |= 1 << 8 << (this.ea[e] >> 1);
sum ^= this.ea[e] & 1;
ep.push(this.ea[e] >> 1);
}
var cp = [];
for (var c = 0; c < 8; c++) {
Expand All @@ -605,7 +607,7 @@ var mathlib = (function() {
cp.push(this.ca[c] & 0x7);
}
if (mask != 0xfffff || sum % 6 != 0
|| getNParity(getNPerm(this.ea, 12), 12) != getNParity(getNPerm(cp, 8), 8)) {
|| getNParity(getNPerm(ep, 12), 12) != getNParity(getNPerm(cp, 8), 8)) {
return -1;
}
return 0;
Expand Down

0 comments on commit 11e601a

Please sign in to comment.