Skip to content

Commit

Permalink
turnaround: Add isCmp for hatenas
Browse files Browse the repository at this point in the history
  • Loading branch information
x-sheep committed Sep 9, 2024
1 parent 0a7415d commit 85358ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/variety/turnaround.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
maxnum: 3,

isCmp: function() {
if (!this.puzzle.execConfig("autocmp")) {
if (!this.puzzle.execConfig("autocmp") || !this.isNum()) {
return false;
}
return this.qnum === this.countTurn();
var count = this.countTurn();
return this.qnum === count || (this.qnum === -2 && count >= 0);
},

countTurn: function() {
if (!this.isNum() || this.lcnt !== 2) {
if (this.lcnt !== 2) {
return -1;
}

Expand Down

0 comments on commit 85358ce

Please sign in to comment.