From 1bab081eb87675556e1194cc121f8da5720ca4af Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sun, 23 Feb 2025 20:33:40 +0100 Subject: [PATCH] kurochute, nothree: Add pekes --- src/variety/kurochute.js | 7 ++++++- src/variety/nothree.js | 19 ++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/variety/kurochute.js b/src/variety/kurochute.js index d06cd781a..cd63796ce 100644 --- a/src/variety/kurochute.js +++ b/src/variety/kurochute.js @@ -15,7 +15,7 @@ use: true, inputModes: { edit: ["number", "clear"], - play: ["shade", "unshade", "completion"] + play: ["shade", "unshade", "peke", "completion"] }, mouseinput_auto: function() { if (this.puzzle.playmode) { @@ -75,6 +75,7 @@ } }, Board: { + hasborder: 1, cols: 8, rows: 8 }, @@ -99,6 +100,8 @@ this.drawChassis(); + this.drawPekes(); + this.drawTarget(); }, @@ -134,10 +137,12 @@ decodeData: function() { this.decodeCellQnum(); this.decodeCellQanssubcmp(); + this.decodeBorderLine(); }, encodeData: function() { this.encodeCellQnum(); this.encodeCellQanssubcmp(); + this.encodeBorderLineIfPresent(); }, decodeCellQanssubcmp: function() { diff --git a/src/variety/nothree.js b/src/variety/nothree.js index 927c02429..07962db5a 100644 --- a/src/variety/nothree.js +++ b/src/variety/nothree.js @@ -12,7 +12,7 @@ use: true, inputModes: { edit: ["circle-unshade", "info-blk"], - play: ["shade", "unshade", "info-blk"] + play: ["shade", "unshade", "peke", "info-blk"] }, inputFixedNumber: function() { this.inputdot(); @@ -92,6 +92,19 @@ dotCells: function() { return new this.klass.CellList(this.sidecell); + }, + + prehook: { + qsub: function(num) { + return num && this.qnum; + } + }, + posthook: { + qnum: function(num) { + if (num) { + this.setQsub(0); + } + } } }, Board: { @@ -129,6 +142,8 @@ this.drawChassis(); + this.drawPekes(); + this.drawCursor(false, this.puzzle.editmode); }, @@ -152,10 +167,12 @@ decodeData: function() { this.decodeDotFile(); this.decodeCellAns(); + this.decodeBorderLine(); }, encodeData: function() { this.encodeDotFile(); this.encodeCellAns(); + this.encodeBorderLineIfPresent(); } },