Skip to content

Commit

Permalink
timebomb: Allow merging question mark bomb with answer bomb
Browse files Browse the repository at this point in the history
  • Loading branch information
x-sheep committed Dec 15, 2024
1 parent dcb695a commit cd6368e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/variety/bonsan.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,13 @@
return false;
}

if (
this.sidecell[0].path.departure.qnum === -2 ||
this.sidecell[1].path.departure.qnum === -2
) {
return false;
}

var higher = this.sidecell[0].path.departure.anum === 0 ? 1 : 0;
/* Difference in distance must be exactly 1 */
return (
Expand Down Expand Up @@ -457,6 +464,7 @@
component.clist.each(function(c) {
c.distance = null;
});
component.clist.draw();
return;
}

Expand All @@ -465,6 +473,7 @@
num = num >= 0 ? num : isAnum ? 0 : this.board.cell.length;
cell.distance = num;
if (cell.lcnt === 0) {
cell.draw();
return;
}

Expand Down Expand Up @@ -494,6 +503,7 @@
dir = 3;
}
}
component.clist.draw();
}
},

Expand Down
13 changes: 13 additions & 0 deletions test/script/timebomb.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,19 @@ ui.debug.addDebugData("timebomb", {
"mouse,left,1,1,9,1"
],
result: "pzprv3/timebomb/1/5/3 . . . . /0 0 0 0 0 /1 1 1 0 /"
},
{
label: "Allow merging qnum -2 lines",
input: [
"ansclear",
"editmode",
"key,-",
"setconfig,dispmove,true",
"playmode",
"mouse,left,9,1",
"mouse,left,9,1,1,1"
],
result: "pzprv3/timebomb/1/5/- . . . . /0 0 0 0 32 /1 1 1 1 /"
}
]
});

0 comments on commit cd6368e

Please sign in to comment.