From 08500410c958f6f75d09b4fe55d1226d7a7c1761 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sat, 8 Nov 2025 11:02:00 +0100 Subject: [PATCH 01/25] WIP --- src/pzpr/variety.js | 1 + src/res/failcode.en.json | 2 + src/variety-common/MouseInput.js | 19 ++-- src/variety/kaidan.js | 146 ++++++++++++++++++++++++------- 4 files changed, 128 insertions(+), 40 deletions(-) diff --git a/src/pzpr/variety.js b/src/pzpr/variety.js index 97bb1fdc0..e0bfe6a8e 100755 --- a/src/pzpr/variety.js +++ b/src/pzpr/variety.js @@ -155,6 +155,7 @@ dotchi2: [0, 0, "ドッチドッチループ", "Dotchi Dotchi Loop", "country"], doubleback: [0, 0, "Double Back", "Double Back", "country"], easyasabc: [0, 0, "ABCプレース", "Easy as ABC"], + edamame: [0, 0, "Edamame", "Edamame", "kaidan"], evolmino: [0, 0, "シンカミノ", "Evolmino"], factors: [0, 0, "因子の部屋", "Rooms of Factors"], fakearrow: [0, 0, "フェイクアロー", "Fake Arrow", "nagare"], diff --git a/src/res/failcode.en.json b/src/res/failcode.en.json index b3a4571fa..728dd91d0 100644 --- a/src/res/failcode.en.json +++ b/src/res/failcode.en.json @@ -437,6 +437,7 @@ "csDivide.shugaku": "The aisle is divided.", "csDivide": "The shaded cells are divided.", "csDivide8.mochikoro": "The unshaded cells are divided.", + "csGt1.edamame": "A rectangle has more than one circle in the middle.", "csGt1.nothree": "A dot overlaps more than one shaded cell.", "csGt1.sumiwake": "A circle overlaps more than one shaded cell.", "csGt1.takoyaki": "A line has more than one circle in the middle.", @@ -445,6 +446,7 @@ "csGtLimit.kissing": "Two blocks are adjacent in an invalid location.", "csGtN.isowatari": "The size of a mass of shaded cells is greater than the indicated number.", "csLoop.parquet": "There is a loop of shaded cells.", + "csLt1.edamame": "A rectangle has no circle in the middle.", "csLt1.nothree": "A dot doesn't overlap a shaded cell.", "csLt1.sumiwake": "A circle doesn't overlap a shaded cell.", "csLt1.takoyaki": "A line has no circle in the middle.", diff --git a/src/variety-common/MouseInput.js b/src/variety-common/MouseInput.js index edac5ac1d..a0e75c129 100644 --- a/src/variety-common/MouseInput.js +++ b/src/variety-common/MouseInput.js @@ -350,31 +350,32 @@ pzpr.classmgr.makeCommon({ cell.draw(); this.mouseCell = cell; }, - inputBGcolor: function() { + inputBGcolor: function(basevalue) { + basevalue = basevalue || 0; var cell = this.getcell(); if (cell.isnull || cell.is51cell() || cell === this.mouseCell) { return; } if (this.inputData !== null) { } else if (this.inputMode === "bgcolor1") { - this.inputMode = cell.qsub !== 1 ? 11 : 10; + this.inputMode = cell.qsub !== 1 + basevalue ? 11 + basevalue : 10; } else if (this.inputMode === "bgcolor2") { - this.inputMode = cell.qsub !== 2 ? 12 : 10; + this.inputMode = cell.qsub !== 2 + basevalue ? 12 + basevalue : 10; } else if (this.btn === "left") { if (cell.qsub === 0) { - this.inputData = 11; - } else if (cell.qsub === 1) { - this.inputData = 12; + this.inputData = 11 + basevalue; + } else if (cell.qsub === 1 + basevalue) { + this.inputData = 12 + basevalue; } else { this.inputData = 10; } } else { if (cell.qsub === 0) { - this.inputData = 12; - } else if (cell.qsub === 1) { + this.inputData = 12 + basevalue; + } else if (cell.qsub === 1 + basevalue) { this.inputData = 10; } else { - this.inputData = 11; + this.inputData = 11 + basevalue; } } cell.setQsub(this.inputData - 10); diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index 56c99dcfa..265e0b563 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -5,7 +5,7 @@ } else { pzpr.classmgr.makeCustom(pidlist, classbase); } -})(["kaidan", "takoyaki", "wittgen", "zabajaba"], { +})(["kaidan", "takoyaki", "wittgen", "zabajaba", "edamame"], { MouseEvent: { use: true, RBShadeCell: true, @@ -14,13 +14,26 @@ play: ["line", "mark-circle", "peke", "subcross", "completion"] }, mouseinput: function() { - var mode = this.inputMode; - if (mode === "shade") { - this.inputFixedNumber(-2); - } else if (mode === "subcross" || mode === "mark-circle") { - this.inputShade(); - } else { - this.common.mouseinput.call(this); + switch (this.inputMode) { + case "shade": + this.inputFixedNumber(-2); + break; + case "subcross": + case "mark-circle": + this.inputShade(); + break; + case "bgcolor": + this.inputBGcolor(1); + break; + case "bgcolor1": + this.inputFixedQsub(2); + break; + case "bgcolor2": + this.inputFixedQsub(3); + break; + default: + this.common.mouseinput.call(this); + break; } }, decIC: function(cell) { @@ -102,7 +115,7 @@ this.common.mousereset.call(this); } }, - "MouseEvent@kaidan,wittgen": { + "MouseEvent@kaidan,wittgen,edamame": { inputLine: function() { var cell = this.getcell(); var addcmp = false; @@ -175,6 +188,22 @@ } } }, + "MouseEvent@edamame#1": { + RBShadeCell: false, + inputModes: { + edit: ["number", "shade", "clear"], + play: [ + "line", + "mark-circle", + "peke", + "subcross", + "bgcolor", + "bgcolor1", + "bgcolor2", + "completion" + ] + } + }, "MouseEvent@wittgen#1": { inputModes: { edit: ["number", "undef", "clear"], @@ -240,7 +269,7 @@ KeyEvent: { enablemake: true }, - "Border@kaidan": { + "Border@kaidan,edamame": { prehook: { line: function(num) { return (num && this.isLineNG()) || this.checkFormCurve(num); @@ -329,7 +358,7 @@ if (cell.line && cell.lcnt !== 1) { cell.setLineVal(0); } - if (this.line && cell.qsub) { + if (this.line && cell.qsub === 1) { cell.setQsub(0); } cell.draw(); @@ -412,7 +441,7 @@ } } }, - "Cell@takoyaki": { + "Cell@takoyaki,edamame": { noLP: function(dir) { return this.isNum(); }, @@ -420,6 +449,14 @@ return this.qnum === -1; } }, + "Cell@edamame#1": { + isShade: function() { + return !this.isnull && (this.qans === 1 || this.line === 1); + }, + isUnshade: function() { + return !this.isnull && this.lcnt === 0 && !this.isShade(); + } + }, "Cell@wittgen,zabajaba": { isUnshade: function() { return this.lcnt === 0; @@ -474,6 +511,14 @@ return !cell.noLP(); } }, + "AreaUnshadeGraph@edamame": { + enabled: true, + relation: { "border.line": "block", "cell.qans": "node" }, + modifyOtherInfo: function(border, relation) { + this.setEdgeByNodeObj(border.sidecell[0]); + this.setEdgeByNodeObj(border.sidecell[1]); + } + }, "AreaUnshadeGraph@wittgen,zabajaba": { enabled: true, relation: { "border.line": "block" }, @@ -493,7 +538,11 @@ this.drawBGCells(); this.drawGrid(); - if (this.pid !== "wittgen" && this.pid !== "zabajaba") { + if ( + this.pid !== "wittgen" && + this.pid !== "zabajaba" && + this.pid !== "edamame" + ) { this.drawQuesCells(); } this.drawQuesNumbers(); @@ -510,7 +559,8 @@ if ( this.pid === "kaidan" || this.pid === "wittgen" || - this.pid === "zabajaba" + this.pid === "zabajaba" || + this.pid === "edamame" ) { this.drawLineEnds(); } @@ -521,13 +571,15 @@ this.drawTarget(); } }, - "Graphic@kaidan,takoyaki#2": { + "Graphic@kaidan,takoyaki#3": { hideHatena: true, - mbcolor: "rgb(127,127,255)", fontShadecolor: "white", getQuesNumberColor: function(cell) { return cell.qcmp === 1 ? this.qcmpcolor : this.fontShadecolor; - }, + } + }, + "Graphic@kaidan,takoyaki,edamame#2": { + mbcolor: "rgb(127,127,255)", getCircleStrokeColor: function(cell) { if (cell.qans === 1) { @@ -556,7 +608,7 @@ py, shrink = this.pid === "kaidan" && cell.lcnt; g.vid = "c_MB2_" + cell.id; - if (cell.qsub > 0) { + if (cell.qsub === 1) { px = cell.bx * this.bw; py = cell.by * this.bh; g.lineWidth = (1 + this.cw / 40) | 0; @@ -568,7 +620,7 @@ } } }, - "Graphic@kaidan,wittgen,zabajaba": { + "Graphic@kaidan,wittgen,zabajaba,edamame": { drawLines: function() { var g = this.vinc("line", "crispEdges"); var mx = this.bw / 2; @@ -668,7 +720,7 @@ "Graphic@takoyaki": { irowake: true }, - "Graphic@wittgen,zabajaba#1": { + "Graphic@wittgen,zabajaba,edamame#1": { getQuesNumberColor: function(cell) { if ((cell.error || cell.qinfo) === 1) { return this.errcolor1; @@ -724,6 +776,18 @@ return isTrial ? "rgb(222,222,222)" : this.qsubcolor1; } }, + "Graphic@edamame": { + getBGCellColor: function(cell) { + if ((cell.error || cell.qinfo) === 1) { + return this.errbcolor1; + } else if (cell.qsub === 2) { + return this.qsubcolor1; + } else if (cell.qsub === 3) { + return this.qsubcolor2; + } + return null; + } + }, Encode: { decodePzpr: function(type) { @@ -743,6 +807,7 @@ }, FileIO: { decodeData: function() { + // TODO fileIO for backgrounds var hasQans = this.pid !== "wittgen" && this.pid !== "zabajaba"; this.decodeCellQnum(); this.decodeCell(function(cell, ca) { @@ -767,6 +832,7 @@ this.decodeBorderLine(); }, encodeData: function() { + // TODO fileIO for backgrounds var hasQans = this.pid !== "wittgen" && this.pid !== "zabajaba"; this.encodeCellQnum(); this.encodeCell(function(cell) { @@ -904,40 +970,42 @@ return cell.qans === 1 && cell.path ? cell.path.id : -1; }); }, - checkNumberOfMiddle: function() { + checkLoop: function() { var paths = this.board.linegraph.components; for (var r = 0; r < paths.length; r++) { var path = paths[r]; - var circles = path.clist.filter(function(c) { - return c.lcnt >= 2 && c.qans === 1; - }); - if (circles.length <= 1) { + if (path.circuits === 0) { continue; } - this.failcode.add("csGt1"); + this.failcode.add("laLoop"); if (this.checkOnly) { break; } this.board.border.setnoerr(); path.setedgeerr(1); - circles.seterr(1); } - }, - checkLoop: function() { + } + }, + "AnsCheck@takoyaki,edamame#2": { + checkNumberOfMiddle: function() { var paths = this.board.linegraph.components; for (var r = 0; r < paths.length; r++) { var path = paths[r]; - if (path.circuits === 0) { + var circles = path.clist.filter(function(c) { + return c.lcnt >= 2 && c.qans === 1; + }); + if (circles.length <= 1) { continue; } - this.failcode.add("laLoop"); + this.failcode.add("csGt1"); if (this.checkOnly) { break; } this.board.border.setnoerr(); path.setedgeerr(1); + circles.seterr(1); } }, checkNoMiddle: function() { @@ -1093,7 +1161,23 @@ this.checkDir8(-1, "nmLineLt"); } }, + "AnsCheck@edamame#1": { + checklist: [ + "checkLineOverlap", + "checkDir4ShadeOver", + "checkNumberOfMiddle", + "checkConnectUnshade", + "checkDir4ShadeLess", + "checkNoMiddle", + "checkMissingEnd" + ] + + // TODO combine line end with placing circle I guess + }, "FailCode@takoyaki": { lnOnShade: "lnOnShade" + }, + "FailCode@edamame": { + cuDivide: "cuDivide.wittgen" } }); From ff9dc460af72a7cc1bc3f97b0a1d1c02c9ce9149 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sat, 13 Dec 2025 18:46:43 +0100 Subject: [PATCH 02/25] Update graphics --- src/variety/kaidan.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index 265e0b563..465a40ada 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -536,7 +536,11 @@ paint: function() { this.drawBGCells(); - this.drawGrid(); + if (this.pid === "edamame") { + this.drawDashedGrid(); + } else { + this.drawGrid(); + } if ( this.pid !== "wittgen" && @@ -580,6 +584,7 @@ }, "Graphic@kaidan,takoyaki,edamame#2": { mbcolor: "rgb(127,127,255)", + circlestrokecolor: "black", getCircleStrokeColor: function(cell) { if (cell.qans === 1) { @@ -588,7 +593,7 @@ } else if (cell.trial) { return this.trialcolor; } else { - return this.quescolor; + return this.circlestrokecolor; } } return null; @@ -621,10 +626,12 @@ } }, "Graphic@kaidan,wittgen,zabajaba,edamame": { + doubleLineWidth: 0.5, + drawLines: function() { var g = this.vinc("line", "crispEdges"); - var mx = this.bw / 2; - var my = this.bh / 2; + var mx = this.bw * this.doubleLineWidth; + var my = this.bh * this.doubleLineWidth; var blist = this.range.borders; for (var i = 0; i < blist.length; i++) { @@ -676,8 +683,8 @@ }, drawLineEnds: function() { var g = this.vinc("lineends", "auto"); - var mx = this.bw / 2; - var my = this.bh / 2; + var mx = this.bw * this.doubleLineWidth; + var my = this.bh * this.doubleLineWidth; var clist = this.range.cells; for (var i = 0; i < clist.length; i++) { var cell = clist[i], @@ -777,6 +784,10 @@ } }, "Graphic@edamame": { + circleratio: [0.25, 0.2], + doubleLineWidth: 0.7, + circlestrokecolor: "rgb(0, 160, 0)", + getBGCellColor: function(cell) { if ((cell.error || cell.qinfo) === 1) { return this.errbcolor1; From 6c938bd2aab9c63601502bb9f844784197e6032e Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sun, 15 Feb 2026 16:41:16 +0100 Subject: [PATCH 03/25] Add cycle through circle/end/blank --- src/variety/kaidan.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index 465a40ada..8265e9415 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -68,7 +68,17 @@ } if (this.pid !== "takoyaki" && cell.lcnt === 1 && this.btn === "left") { - cell.setLineVal(+!cell.line); + if (this.pid !== "edamame") { + cell.setLineVal(+!cell.line); + } else if (!cell.qans) { + cell.setQans(1); + cell.setQsub(0); + } else if (!cell.line) { + cell.setLineVal(1); + } else { + cell.setLineVal(0); + cell.setQans(0); + } cell.draw(); } else if (cell.isNum()) { this.inputqcmp(); @@ -450,9 +460,6 @@ } }, "Cell@edamame#1": { - isShade: function() { - return !this.isnull && (this.qans === 1 || this.line === 1); - }, isUnshade: function() { return !this.isnull && this.lcnt === 0 && !this.isShade(); } @@ -1182,8 +1189,6 @@ "checkNoMiddle", "checkMissingEnd" ] - - // TODO combine line end with placing circle I guess }, "FailCode@takoyaki": { lnOnShade: "lnOnShade" From 17b6fb77636f040f36ef80274f232c250aa24068 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sun, 15 Feb 2026 16:58:33 +0100 Subject: [PATCH 04/25] WIP --- src/variety/kaidan.js | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index 8265e9415..eee0272a9 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -22,13 +22,12 @@ case "mark-circle": this.inputShade(); break; - case "bgcolor": - this.inputBGcolor(1); - break; case "bgcolor1": + // TODO: change this this.inputFixedQsub(2); break; case "bgcolor2": + // TODO: change that this.inputFixedQsub(3); break; default: @@ -212,6 +211,39 @@ "bgcolor2", "completion" ] + }, + inputBGcolor: function() { + var basevalue = 1; + var cell = this.getcell(); + if (cell.isnull || cell.is51cell() || cell === this.mouseCell) { + return; + } + if (this.inputData !== null) { + } else if (this.inputMode === "bgcolor1") { + this.inputMode = cell.qsub !== 1 + basevalue ? 11 + basevalue : 10; + } else if (this.inputMode === "bgcolor2") { + this.inputMode = cell.qsub !== 2 + basevalue ? 12 + basevalue : 10; + } else if (this.btn === "left") { + if (cell.qsub === 0) { + this.inputData = 11 + basevalue; + } else if (cell.qsub === 1 + basevalue) { + this.inputData = 12 + basevalue; + } else { + this.inputData = 10; + } + } else { + if (cell.qsub === 0) { + this.inputData = 12 + basevalue; + } else if (cell.qsub === 1 + basevalue) { + this.inputData = 10; + } else { + this.inputData = 11 + basevalue; + } + } + cell.setQsub(this.inputData - 10); + cell.draw(); + + this.mouseCell = cell; } }, "MouseEvent@wittgen#1": { @@ -798,9 +830,9 @@ getBGCellColor: function(cell) { if ((cell.error || cell.qinfo) === 1) { return this.errbcolor1; - } else if (cell.qsub === 2) { + } else if (cell.qsub & 2) { return this.qsubcolor1; - } else if (cell.qsub === 3) { + } else if (cell.qsub & 4) { return this.qsubcolor2; } return null; From b8160bf65a3b455b67c8e6c4dd35ec55c2e65936 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sun, 15 Feb 2026 17:19:27 +0100 Subject: [PATCH 05/25] WIP of combining qsub values --- src-ui/list.html | 1 + src/variety-common/MouseInput.js | 19 ++++++------ src/variety/kaidan.js | 50 +++++++++++++++++--------------- 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/src-ui/list.html b/src-ui/list.html index 00d963e4b..6fe2ba9c2 100644 --- a/src-ui/list.html +++ b/src-ui/list.html @@ -402,6 +402,7 @@

パズルの種類のリスト
  • +
  • diff --git a/src/variety-common/MouseInput.js b/src/variety-common/MouseInput.js index a0e75c129..edac5ac1d 100644 --- a/src/variety-common/MouseInput.js +++ b/src/variety-common/MouseInput.js @@ -350,32 +350,31 @@ pzpr.classmgr.makeCommon({ cell.draw(); this.mouseCell = cell; }, - inputBGcolor: function(basevalue) { - basevalue = basevalue || 0; + inputBGcolor: function() { var cell = this.getcell(); if (cell.isnull || cell.is51cell() || cell === this.mouseCell) { return; } if (this.inputData !== null) { } else if (this.inputMode === "bgcolor1") { - this.inputMode = cell.qsub !== 1 + basevalue ? 11 + basevalue : 10; + this.inputMode = cell.qsub !== 1 ? 11 : 10; } else if (this.inputMode === "bgcolor2") { - this.inputMode = cell.qsub !== 2 + basevalue ? 12 + basevalue : 10; + this.inputMode = cell.qsub !== 2 ? 12 : 10; } else if (this.btn === "left") { if (cell.qsub === 0) { - this.inputData = 11 + basevalue; - } else if (cell.qsub === 1 + basevalue) { - this.inputData = 12 + basevalue; + this.inputData = 11; + } else if (cell.qsub === 1) { + this.inputData = 12; } else { this.inputData = 10; } } else { if (cell.qsub === 0) { - this.inputData = 12 + basevalue; - } else if (cell.qsub === 1 + basevalue) { + this.inputData = 12; + } else if (cell.qsub === 1) { this.inputData = 10; } else { - this.inputData = 11 + basevalue; + this.inputData = 11; } } cell.setQsub(this.inputData - 10); diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index eee0272a9..3401e5040 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -23,12 +23,8 @@ this.inputShade(); break; case "bgcolor1": - // TODO: change this - this.inputFixedQsub(2); - break; case "bgcolor2": - // TODO: change that - this.inputFixedQsub(3); + this.inputBGcolor(); break; default: this.common.mouseinput.call(this); @@ -213,37 +209,38 @@ ] }, inputBGcolor: function() { - var basevalue = 1; var cell = this.getcell(); - if (cell.isnull || cell.is51cell() || cell === this.mouseCell) { + if (cell.isnull || cell === this.mouseCell) { return; } if (this.inputData !== null) { } else if (this.inputMode === "bgcolor1") { - this.inputMode = cell.qsub !== 1 + basevalue ? 11 + basevalue : 10; + this.inputData = cell.qsub & 2 ? 10 : 12; } else if (this.inputMode === "bgcolor2") { - this.inputMode = cell.qsub !== 2 + basevalue ? 12 + basevalue : 10; + this.inputData = cell.qsub & 4 ? 10 : 14; } else if (this.btn === "left") { - if (cell.qsub === 0) { - this.inputData = 11 + basevalue; - } else if (cell.qsub === 1 + basevalue) { - this.inputData = 12 + basevalue; - } else { + if (cell.qsub & 2) { + this.inputData = 14; + } else if (cell.qsub & 4) { this.inputData = 10; + } else { + this.inputData = 12; } } else { - if (cell.qsub === 0) { - this.inputData = 12 + basevalue; - } else if (cell.qsub === 1 + basevalue) { + if (cell.qsub & 2) { this.inputData = 10; + } else if (cell.qsub & 4) { + this.inputData = 12; } else { - this.inputData = 11 + basevalue; + this.inputData = 14; } } - cell.setQsub(this.inputData - 10); - cell.draw(); - this.mouseCell = cell; + if (this.inputData >= 10) { + cell.setQsub((cell.qsub & ~6) | (this.inputData - 10)); + cell.draw(); + this.mouseCell = cell; + } } }, "MouseEvent@wittgen#1": { @@ -652,7 +649,7 @@ py, shrink = this.pid === "kaidan" && cell.lcnt; g.vid = "c_MB2_" + cell.id; - if (cell.qsub === 1) { + if (cell.qsub & 1) { px = cell.bx * this.bw; py = cell.by * this.bh; g.lineWidth = (1 + this.cw / 40) | 0; @@ -766,7 +763,7 @@ "Graphic@takoyaki": { irowake: true }, - "Graphic@wittgen,zabajaba,edamame#1": { + "Graphic@wittgen,zabajaba#1": { getQuesNumberColor: function(cell) { if ((cell.error || cell.qinfo) === 1) { return this.errcolor1; @@ -827,6 +824,13 @@ doubleLineWidth: 0.7, circlestrokecolor: "rgb(0, 160, 0)", + getQuesNumberColor: function(cell) { + if ((cell.error || cell.qinfo) === 1) { + return this.errcolor1; + } + return cell.qcmp ? this.qcmpcolor : this.quescolor; + }, + getBGCellColor: function(cell) { if ((cell.error || cell.qinfo) === 1) { return this.errbcolor1; From 631d72751d079efd6820469668d210129c3059a9 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Tue, 17 Feb 2026 15:49:33 +0100 Subject: [PATCH 06/25] Add missing check --- src/res/failcode.en.json | 1 + src/variety/kaidan.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/res/failcode.en.json b/src/res/failcode.en.json index 728dd91d0..01149128e 100644 --- a/src/res/failcode.en.json +++ b/src/res/failcode.en.json @@ -477,6 +477,7 @@ "cuDivide.wittgen": "The cells not used by rectangles are divided.", "cuDivide": "The unshaded cells are divided.", "cuDivideRB": "The unshaded cells are divided.", + "cuEndpoint.edamame": "The corner of a rectangle does not have a circle.", "cuEndpoint.takoyaki": "An endpoint does not have a circle.", "cuLoop": "There is a loop of unshaded cells.", "cuLower.stostone": "Unshaded cells exist in the lower half of the board after the blocks have fallen.", diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index 3401e5040..ce33eaab7 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -208,6 +208,8 @@ "completion" ] }, + // TODO change behavior of inputShade with crosses + // TODO change behavior of subcross input mode inputBGcolor: function() { var cell = this.getcell(); if (cell.isnull || cell === this.mouseCell) { @@ -1222,6 +1224,7 @@ "checkNumberOfMiddle", "checkConnectUnshade", "checkDir4ShadeLess", + "checkEndpoints", "checkNoMiddle", "checkMissingEnd" ] From 30364f46dc0124ac2811fe8e38932ad52d9cafb6 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Tue, 17 Feb 2026 16:00:47 +0100 Subject: [PATCH 07/25] Introduce new qsub2 property --- src/puzzle/Operation.js | 2 ++ src/puzzle/Piece.js | 5 ++++- src/variety-common/MouseInput.js | 4 ++-- src/variety/kaidan.js | 36 +++++++++----------------------- 4 files changed, 18 insertions(+), 29 deletions(-) diff --git a/src/puzzle/Operation.js b/src/puzzle/Operation.js index 71023f6d5..0bcccbc73 100644 --- a/src/puzzle/Operation.js +++ b/src/puzzle/Operation.js @@ -72,11 +72,13 @@ pzpr.classmgr.makeCommon({ U: "ques", N: "qnum", Z: "qnum2", + // R is "qnums" C: "qchar", M: "anum", D: "qdir", A: "qans", S: "qsub", + E: "qsub2", K: "qcmp", B: "snum", L: "line" diff --git a/src/puzzle/Piece.js b/src/puzzle/Piece.js index 9c3197fe9..fe7d28e38 100644 --- a/src/puzzle/Piece.js +++ b/src/puzzle/Piece.js @@ -35,6 +35,7 @@ pzpr.classmgr.makeCommon({ /* 補助データを保持するプロパティ */ qsub: 0, // cell :(1:白マス 1-2:背景色/○× 3:絵になる部分) + qsub2: 0, // border:(1:補助線 2:× 11-14:方向記号) qcmp: 0, // cell :(1:cmpマス 1-2:○×) snum: -1, // cell :補助数字を保持する @@ -55,7 +56,7 @@ pzpr.classmgr.makeCommon({ "qnums" ], propans: ["qans", "anum", "line", "trial"], - propsub: ["qsub", "qcmp", "snum"], + propsub: ["qsub", "qsub2", "qcmp", "snum"], propinfo: ["error", "qinfo"], propnorec: { color: 1, error: 1, qinfo: 1 }, @@ -113,6 +114,8 @@ pzpr.classmgr.makeCommon({ }, setQsub: function(val) { this.setdata("qsub", val); + },setQsub2: function(val) { + this.setdata("qsub2", val); }, setQcmp: function(val) { this.setdata("qcmp", val); diff --git a/src/variety-common/MouseInput.js b/src/variety-common/MouseInput.js index edac5ac1d..05ee23d07 100644 --- a/src/variety-common/MouseInput.js +++ b/src/variety-common/MouseInput.js @@ -357,9 +357,9 @@ pzpr.classmgr.makeCommon({ } if (this.inputData !== null) { } else if (this.inputMode === "bgcolor1") { - this.inputMode = cell.qsub !== 1 ? 11 : 10; + this.inputData = cell.qsub !== 1 ? 11 : 10; } else if (this.inputMode === "bgcolor2") { - this.inputMode = cell.qsub !== 2 ? 12 : 10; + this.inputData = cell.qsub !== 2 ? 12 : 10; } else if (this.btn === "left") { if (cell.qsub === 0) { this.inputData = 11; diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index ce33eaab7..dd3193154 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -208,8 +208,6 @@ "completion" ] }, - // TODO change behavior of inputShade with crosses - // TODO change behavior of subcross input mode inputBGcolor: function() { var cell = this.getcell(); if (cell.isnull || cell === this.mouseCell) { @@ -217,32 +215,18 @@ } if (this.inputData !== null) { } else if (this.inputMode === "bgcolor1") { - this.inputData = cell.qsub & 2 ? 10 : 12; + this.inputData = cell.qsub2 !== 1 ? 11 : 10; } else if (this.inputMode === "bgcolor2") { - this.inputData = cell.qsub & 4 ? 10 : 14; + this.inputData = cell.qsub2 !== 2 ? 12 : 10; } else if (this.btn === "left") { - if (cell.qsub & 2) { - this.inputData = 14; - } else if (cell.qsub & 4) { - this.inputData = 10; - } else { - this.inputData = 12; - } + this.inputData = cell.qsub2 === 0 ? 11 : cell.qsub2 === 1 ? 12 : 10; } else { - if (cell.qsub & 2) { - this.inputData = 10; - } else if (cell.qsub & 4) { - this.inputData = 12; - } else { - this.inputData = 14; - } + this.inputData = cell.qsub2 === 0 ? 12 : cell.qsub2 === 1 ? 10 : 11; } + cell.setQsub2(this.inputData - 10); + cell.draw(); - if (this.inputData >= 10) { - cell.setQsub((cell.qsub & ~6) | (this.inputData - 10)); - cell.draw(); - this.mouseCell = cell; - } + this.mouseCell = cell; } }, "MouseEvent@wittgen#1": { @@ -651,7 +635,7 @@ py, shrink = this.pid === "kaidan" && cell.lcnt; g.vid = "c_MB2_" + cell.id; - if (cell.qsub & 1) { + if (cell.qsub === 1) { px = cell.bx * this.bw; py = cell.by * this.bh; g.lineWidth = (1 + this.cw / 40) | 0; @@ -836,9 +820,9 @@ getBGCellColor: function(cell) { if ((cell.error || cell.qinfo) === 1) { return this.errbcolor1; - } else if (cell.qsub & 2) { + } else if (cell.qsub2 === 1) { return this.qsubcolor1; - } else if (cell.qsub & 4) { + } else if (cell.qsub2 === 2) { return this.qsubcolor2; } return null; From 714085c2bb96e5235471f0b80194f3582525856e Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Tue, 17 Feb 2026 16:05:41 +0100 Subject: [PATCH 08/25] Add new qsub2 property --- src/variety/kaidan.js | 17 ++++++++++++++--- test/script/edamame.js | 12 ++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 test/script/edamame.js diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index dd3193154..56f1944cb 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -847,7 +847,6 @@ }, FileIO: { decodeData: function() { - // TODO fileIO for backgrounds var hasQans = this.pid !== "wittgen" && this.pid !== "zabajaba"; this.decodeCellQnum(); this.decodeCell(function(cell, ca) { @@ -868,18 +867,30 @@ if (val & 8) { cell.qcmp = 1; } + if (val & 16) { + cell.qsub2 = 1; + } + if (val & 32) { + cell.qsub2 = 2; + } }); this.decodeBorderLine(); }, encodeData: function() { - // TODO fileIO for backgrounds var hasQans = this.pid !== "wittgen" && this.pid !== "zabajaba"; this.encodeCellQnum(); this.encodeCell(function(cell) { var ans = hasQans ? cell.qans === 1 : cell.qsub === 2; var sub = cell.qsub === 1; - return (+ans | (cell.line << 1) | (+sub << 2) | (cell.qcmp << 3)) + " "; + var value = + +ans | + (cell.line << 1) | + (+sub << 2) | + (cell.qcmp << 3) | + (cell.qsub2 << 4); + + return value + " "; }); this.encodeBorderLine(); } diff --git a/test/script/edamame.js b/test/script/edamame.js new file mode 100644 index 000000000..e3bea3116 --- /dev/null +++ b/test/script/edamame.js @@ -0,0 +1,12 @@ +/* edamame.js */ + +ui.debug.addDebugData("edamame", { + url: "3/3/h0bi", + failcheck: [ + [ + null, + "pzprv3/edamame/3/3/. . 0 /1 . . /. . . /0 0 0 /0 0 0 /3 1 3 /0 0 /0 0 /1 1 /0 0 0 /0 0 0 /" + ] + ], + inputs: [] +}); From c8b713d7f600bba08908641678111b9e42f9ead3 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Tue, 17 Feb 2026 16:16:45 +0100 Subject: [PATCH 09/25] Fix --- src/puzzle/Piece.js | 3 ++- src/variety/kaidan.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/puzzle/Piece.js b/src/puzzle/Piece.js index fe7d28e38..5ffda7b85 100644 --- a/src/puzzle/Piece.js +++ b/src/puzzle/Piece.js @@ -114,7 +114,8 @@ pzpr.classmgr.makeCommon({ }, setQsub: function(val) { this.setdata("qsub", val); - },setQsub2: function(val) { + }, + setQsub2: function(val) { this.setdata("qsub2", val); }, setQcmp: function(val) { diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index 56f1944cb..d1358927a 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -383,7 +383,7 @@ if (cell.line && cell.lcnt !== 1) { cell.setLineVal(0); } - if (this.line && cell.qsub === 1) { + if (this.line && cell.qsub) { cell.setQsub(0); } cell.draw(); @@ -635,7 +635,7 @@ py, shrink = this.pid === "kaidan" && cell.lcnt; g.vid = "c_MB2_" + cell.id; - if (cell.qsub === 1) { + if (cell.qsub > 0) { px = cell.bx * this.bw; py = cell.by * this.bh; g.lineWidth = (1 + this.cw / 40) | 0; From cd445c021df4ac1dc684214c4ded1fb36a3bfb77 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Tue, 17 Feb 2026 16:31:00 +0100 Subject: [PATCH 10/25] Add keypopup --- src-ui/js/ui/KeyPopup.js | 3 ++- src/variety/kaidan.js | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src-ui/js/ui/KeyPopup.js b/src-ui/js/ui/KeyPopup.js index 1b6e542bc..702a8e8c2 100644 --- a/src-ui/js/ui/KeyPopup.js +++ b/src-ui/js/ui/KeyPopup.js @@ -245,7 +245,8 @@ ui.keypopup = { cornerch: [10, 0], keywest: [4, 4], oasis: [10, 0], - bhaibahan: [10, 0] + bhaibahan: [10, 0], + edamame: [4, 0] }, //--------------------------------------------------------------------------- diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index 8d43997a9..eb24e8424 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -41,6 +41,14 @@ }, mouseinput_auto: function() { if (this.puzzle.playmode) { + if (this.mousestart) { + this.isDraggingBG = this.pid === "edamame" && this.puzzle.key.isALT; + } + if (this.isDraggingBG) { + this.inputBGcolor(); + return; + } + if (this.btn === "right") { this.inputdragcross(); } else { @@ -195,7 +203,7 @@ "MouseEvent@edamame#1": { RBShadeCell: false, inputModes: { - edit: ["number", "shade", "clear"], + edit: ["number", "undef", "clear"], play: [ "line", "mark-circle", From f9ad4f0275dad24c27463a17a6e1b5dfcb3aad07 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Tue, 17 Feb 2026 18:32:37 +0100 Subject: [PATCH 11/25] Add input tests --- test/script/edamame.js | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/test/script/edamame.js b/test/script/edamame.js index e3bea3116..dee69d471 100644 --- a/test/script/edamame.js +++ b/test/script/edamame.js @@ -8,5 +8,37 @@ ui.debug.addDebugData("edamame", { "pzprv3/edamame/3/3/. . 0 /1 . . /. . . /0 0 0 /0 0 0 /3 1 3 /0 0 /0 0 /1 1 /0 0 0 /0 0 0 /" ] ], - inputs: [] + inputs: [ + { + input: [ + "newboard,3,2", + "playmode", + "mouse,left,1,1", + "mouse,right,3,1", + "mouse,alt+left,3,1", + "mouse,alt+right,5,1" + ], + result: + "pzprv3/edamame/2/3/. . . /. . . /1 20 32 /0 0 0 /0 0 /0 0 /0 0 0 /" + }, + { + input: ["mouse,left,1,3,3,3", "mouse,left,1,3", "mouse,leftx2,3,3"], + result: + "pzprv3/edamame/2/3/. . . /. . . /1 20 32 /1 3 0 /0 0 /1 0 /0 0 0 /" + }, + { + input: [ + "playmode,bgcolor1", + "mouse,left,5,3", + "playmode,bgcolor2", + "mouse,left,3,3", + "playmode,mark-circle", + "mouse,left,5,1", + "playmode,subcross", + "mouse,left,5,3" + ], + result: + "pzprv3/edamame/2/3/. . . /. . . /1 20 33 /1 35 20 /0 0 /1 0 /0 0 0 /" + } + ] }); From d2060ebdd579063114ad4a289f49bea230377801 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Tue, 17 Feb 2026 22:10:13 +0100 Subject: [PATCH 12/25] Add missing check --- src/res/failcode.en.json | 1 + src/variety/kaidan.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/res/failcode.en.json b/src/res/failcode.en.json index 2bf99ec17..a2cc92c4c 100644 --- a/src/res/failcode.en.json +++ b/src/res/failcode.en.json @@ -465,6 +465,7 @@ "csNoSupport.aquarium": "A water cell is next to or above an empty cell.", "csNotBottom.dosufuwa": "An iron ball is not on the bottom of the row or on another iron ball.", "csNotOnShade.tawa": "There are no shaded cells under a shaded cell.", + "csNotOnLine.edamame": "A circle is not inside a rectangle.", "csNotRect": "A mass of shaded cells is not rectangle.", "csNotSquare": "A group of shaded cells is not a square.", "csOnArrow": "A cell with a clue is shaded.", diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index eb24e8424..c6465cecf 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -1228,8 +1228,14 @@ "checkDir4ShadeLess", "checkEndpoints", "checkNoMiddle", + "checkCircleWithoutLine", "checkMissingEnd" - ] + ], + checkCircleWithoutLine: function() { + this.checkAllCell(function(cell) { + return cell.qans === 1 && cell.lcnt === 0; + }, "csNotOnLine"); + } }, "FailCode@takoyaki": { lnOnShade: "lnOnShade" From fa8020a32c8085f4e44cb7c5f494a496ed1f3b8e Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Fri, 20 Feb 2026 10:57:15 +0100 Subject: [PATCH 13/25] Add example puzzle --- test/script/edamame.js | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/test/script/edamame.js b/test/script/edamame.js index dee69d471..48af4f1b5 100644 --- a/test/script/edamame.js +++ b/test/script/edamame.js @@ -1,11 +1,47 @@ /* edamame.js */ ui.debug.addDebugData("edamame", { - url: "3/3/h0bi", + url: "5/5/0cjcgbiaj", failcheck: [ + [ + "laCurve", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 0 0 0 /0 0 0 0 0 /3 0 0 0 0 /1 1 3 0 0 /3 0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /1 1 0 0 /0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /1 0 0 0 0 /1 0 0 0 0 /" + ], + [ + "nmShadeGt", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 3 /0 0 0 0 3 /0 0 0 0 0 /0 0 0 0 1 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 1 /" + ], + [ + "nmShadeLt", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 3 /0 0 0 0 3 /0 0 0 0 1 /0 0 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 1 /" + ], + [ + "csLt1", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 3 /0 3 0 0 3 /0 1 0 0 0 /0 3 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 1 0 0 1 /0 1 0 0 1 /0 0 0 0 1 /" + ], + [ + "cuDivide", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 3 /0 3 0 0 3 /0 1 0 0 1 /0 0 0 0 0 /0 3 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 1 0 0 1 /0 1 0 0 1 /0 1 0 0 1 /" + ], + [ + "ceNoEnd", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 1 1 3 /0 3 0 0 3 /0 1 0 4 1 /0 3 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 1 0 0 1 /0 1 0 0 1 /0 0 0 0 1 /" + ], + [ + "csNotOnLine", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 3 /0 1 0 0 3 /0 1 0 0 1 /0 0 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 1 /" + ], + [ + "csGt1", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 0 0 3 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 0 /0 0 0 0 3 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 1 /" + ], + [ + "cuEndpoint", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 2 /0 3 0 0 3 /0 1 0 0 1 /0 3 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 1 0 0 1 /0 1 0 0 1 /0 0 0 0 1 /" + ], [ null, - "pzprv3/edamame/3/3/. . 0 /1 . . /. . . /0 0 0 /0 0 0 /3 1 3 /0 0 /0 0 /1 1 /0 0 0 /0 0 0 /" + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 3 /0 3 0 0 3 /0 1 0 0 1 /0 3 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 1 0 0 1 /0 1 0 0 1 /0 0 0 0 1 /" ] ], inputs: [ From 3013f94dd708da1d99abb6cd9650766bd9a39cda Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Wed, 25 Feb 2026 15:57:12 +0100 Subject: [PATCH 14/25] Auto-place circle when drawing line closure --- src/variety/kaidan.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index c6465cecf..0c7dacae2 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -470,6 +470,11 @@ this.adjborder[dir].setLineVal(0); } } + }, + line: function(val) { + if (val && this.pid === "edamame") { + this.setQans(1); + } } } }, From 8926e53a626aa6cf605469e650398be0f2c9d9f9 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Wed, 25 Feb 2026 15:57:47 +0100 Subject: [PATCH 15/25] Add to changes --- src-ui/changes.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ui/changes.html b/src-ui/changes.html index 7f7ca0a9e..f2bac16f5 100644 --- a/src-ui/changes.html +++ b/src-ui/changes.html @@ -33,13 +33,13 @@
    Latest types (all types)
    From 955531f62c38c2a401900f626dc06e6c5b5a9973 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Tue, 3 Mar 2026 17:57:38 +0100 Subject: [PATCH 16/25] Remove background colors again, input dots instead --- src/variety/kaidan.js | 93 +++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 48 deletions(-) diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index 0c7dacae2..329ad5d82 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -21,10 +21,6 @@ case "mark-circle": this.inputShade(); break; - case "bgcolor1": - case "bgcolor2": - this.inputBGcolor(); - break; default: this.common.mouseinput.call(this); break; @@ -39,13 +35,35 @@ this.common.decIC.call(this, cell); } }, + inputDotOrDrag: function() { + if (this.mousestart) { + if (this.puzzle.key.isALT) { + this.isDraggingBG = 1; + } else if (this.btn === "left" && this.getcell().qsub === 2) { + // Copy dots + this.isDraggingBG = 2; + this.inputData = 2; + } else { + this.isDraggingBG = 0; + } + } + if (this.isDraggingBG === 2 && this.mouseend && this.notInputted()) { + var cell = this.getcell(); + if (!cell.isnull) { + cell.setQsub(0); + cell.draw(); + } + return true; + } + if (this.isDraggingBG) { + this.inputDot(); + return true; + } + return false; + }, mouseinput_auto: function() { if (this.puzzle.playmode) { - if (this.mousestart) { - this.isDraggingBG = this.pid === "edamame" && this.puzzle.key.isALT; - } - if (this.isDraggingBG) { - this.inputBGcolor(); + if (this.pid === "edamame" && this.inputDotOrDrag()) { return; } @@ -209,31 +227,12 @@ "mark-circle", "peke", "subcross", - "bgcolor", - "bgcolor1", - "bgcolor2", + "objblank", "completion" ] }, - inputBGcolor: function() { - var cell = this.getcell(); - if (cell.isnull || cell === this.mouseCell) { - return; - } - if (this.inputData !== null) { - } else if (this.inputMode === "bgcolor1") { - this.inputData = cell.qsub2 !== 1 ? 11 : 10; - } else if (this.inputMode === "bgcolor2") { - this.inputData = cell.qsub2 !== 2 ? 12 : 10; - } else if (this.btn === "left") { - this.inputData = cell.qsub2 === 0 ? 11 : cell.qsub2 === 1 ? 12 : 10; - } else { - this.inputData = cell.qsub2 === 0 ? 12 : cell.qsub2 === 1 ? 10 : 11; - } - cell.setQsub2(this.inputData - 10); - cell.draw(); - - this.mouseCell = cell; + inputDot: function() { + this.inputFixedQsub(2); } }, "MouseEvent@wittgen#1": { @@ -489,6 +488,14 @@ "Cell@edamame#1": { isUnshade: function() { return !this.isnull && this.lcnt === 0 && !this.isShade(); + }, + isDot: function() { + return this.qsub === 2 && this.lcnt === 0; + }, + prehook: { + qsub: function(num) { + return num === 2 && (this.isNum() || this.lcnt > 0); + } } }, "Cell@wittgen,zabajaba": { @@ -592,6 +599,9 @@ this.drawDotCells(); this.drawMBs(); } + if (this.pid === "edamame") { + this.drawDotCells(); + } this.drawLines(); if ( @@ -647,7 +657,7 @@ py, shrink = this.pid === "kaidan" && cell.lcnt; g.vid = "c_MB2_" + cell.id; - if (cell.qsub > 0) { + if (cell.qsub === 1) { px = cell.bx * this.bw; py = cell.by * this.bh; g.lineWidth = (1 + this.cw / 40) | 0; @@ -827,17 +837,6 @@ return this.errcolor1; } return cell.qcmp ? this.qcmpcolor : this.quescolor; - }, - - getBGCellColor: function(cell) { - if ((cell.error || cell.qinfo) === 1) { - return this.errbcolor1; - } else if (cell.qsub2 === 1) { - return this.qsubcolor1; - } else if (cell.qsub2 === 2) { - return this.qsubcolor2; - } - return null; } }, @@ -880,10 +879,7 @@ cell.qcmp = 1; } if (val & 16) { - cell.qsub2 = 1; - } - if (val & 32) { - cell.qsub2 = 2; + cell.qsub = 2; } }); this.decodeBorderLine(); @@ -894,13 +890,14 @@ this.encodeCell(function(cell) { var ans = hasQans ? cell.qans === 1 : cell.qsub === 2; var sub = cell.qsub === 1; + var sub2 = cell.qsub === 2 && hasQans; var value = +ans | (cell.line << 1) | (+sub << 2) | (cell.qcmp << 3) | - (cell.qsub2 << 4); + (+sub2 << 4); return value + " "; }); From a931e05c1e15a63846a0d7fdf8a965ef1cb4bd3d Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Wed, 4 Mar 2026 16:28:50 +0100 Subject: [PATCH 17/25] Cycle through all marks in One Button mode --- src/variety/kaidan.js | 34 ++++++++++++++++++++++++++++++++++ test/script/edamame.js | 21 +++------------------ 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index 329ad5d82..d20b95398 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -31,6 +31,8 @@ this.inputData = cell.qans !== 1 ? 1 : 0; } else if (this.inputMode === "subcross") { this.inputData = cell.qsub !== 1 ? 2 : 0; + } else if (this.pid === "edamame" && this.puzzle.getConfig("use") === 2) { + this.decIC_edamame(cell); } else { this.common.decIC.call(this, cell); } @@ -233,6 +235,37 @@ }, inputDot: function() { this.inputFixedQsub(2); + }, + decIC_edamame: function(cell) { + var current = cell.qsub > 0 ? cell.qsub + 1 : cell.qans; + var next = this.btn === "left" ? current + 1 : current - 1; + this.inputData = (next + 4) % 4; + }, + inputcell: function() { + var cell = this.getcell(); + if (cell.isnull || cell === this.mouseCell) { + return; + } + if (this.inputData === null) { + this.decIC(cell); + } + + this.mouseCell = cell; + this.initFirstCell(cell); + + if (!cell.allowShade()) { + return; + } + + if (this.inputData <= 1) { + cell.setQans(this.inputData); + cell.setQsub(0); + } else { + cell.setQans(0); + cell.setQsub(this.inputData - 1); + } + + cell.draw(); } }, "MouseEvent@wittgen#1": { @@ -830,6 +863,7 @@ "Graphic@edamame": { circleratio: [0.25, 0.2], doubleLineWidth: 0.7, + qanscolor: "black", circlestrokecolor: "rgb(0, 160, 0)", getQuesNumberColor: function(cell) { diff --git a/test/script/edamame.js b/test/script/edamame.js index 48af4f1b5..62544c24d 100644 --- a/test/script/edamame.js +++ b/test/script/edamame.js @@ -51,30 +51,15 @@ ui.debug.addDebugData("edamame", { "playmode", "mouse,left,1,1", "mouse,right,3,1", - "mouse,alt+left,3,1", - "mouse,alt+right,5,1" + "mouse,alt+left,5,1" ], result: - "pzprv3/edamame/2/3/. . . /. . . /1 20 32 /0 0 0 /0 0 /0 0 /0 0 0 /" + "pzprv3/edamame/2/3/. . . /. . . /1 4 16 /0 0 0 /0 0 /0 0 /0 0 0 /" }, { input: ["mouse,left,1,3,3,3", "mouse,left,1,3", "mouse,leftx2,3,3"], result: - "pzprv3/edamame/2/3/. . . /. . . /1 20 32 /1 3 0 /0 0 /1 0 /0 0 0 /" - }, - { - input: [ - "playmode,bgcolor1", - "mouse,left,5,3", - "playmode,bgcolor2", - "mouse,left,3,3", - "playmode,mark-circle", - "mouse,left,5,1", - "playmode,subcross", - "mouse,left,5,3" - ], - result: - "pzprv3/edamame/2/3/. . . /. . . /1 20 33 /1 35 20 /0 0 /1 0 /0 0 0 /" + "pzprv3/edamame/2/3/. . . /. . . /1 4 16 /1 3 0 /0 0 /1 0 /0 0 0 /" } ] }); From 580d959c8d0013dedf2ae7da8a8416c029b99070 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Thu, 5 Mar 2026 09:18:05 +0100 Subject: [PATCH 18/25] Input tests --- src/puzzle/MouseInput.js | 2 +- src/variety/kaidan.js | 2 +- test/script/edamame.js | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/puzzle/MouseInput.js b/src/puzzle/MouseInput.js index dc4547fe1..7d281e22d 100644 --- a/src/puzzle/MouseInput.js +++ b/src/puzzle/MouseInput.js @@ -442,7 +442,7 @@ pzpr.classmgr.makeCommon({ this.savedInputMode[this.puzzle.editmode ? "edit" : "play"] = mode; this.puzzle.redraw(); } else { - throw Error("Invalid input mode :" + mode); + throw Error("Invalid input mode: " + mode); } }, getInputModeList: function(type) { diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index d20b95398..1725bed1c 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -527,7 +527,7 @@ }, prehook: { qsub: function(num) { - return num === 2 && (this.isNum() || this.lcnt > 0); + return num === 2 && (this.isNum() || this.lcnt > 0 || this.qans); } } }, diff --git a/test/script/edamame.js b/test/script/edamame.js index 62544c24d..ab64fba7f 100644 --- a/test/script/edamame.js +++ b/test/script/edamame.js @@ -60,6 +60,43 @@ ui.debug.addDebugData("edamame", { input: ["mouse,left,1,3,3,3", "mouse,left,1,3", "mouse,leftx2,3,3"], result: "pzprv3/edamame/2/3/. . . /. . . /1 4 16 /1 3 0 /0 0 /1 0 /0 0 0 /" + }, + { + input: ["mouse,left,1,3,3,3", "mouse,left,5,1,5,3,3,3,3,1"], + result: + "pzprv3/edamame/2/3/. . . /. . . /1 16 16 /1 1 16 /0 0 /0 0 /0 0 0 /" + }, + { + label: "Cycle through options", + input: [ + "setconfig,use,2", + "mouse,left,5,1", + "mouse,leftx2,3,1", + "mouse,left,3,3", + "mouse,leftx2,1,3" + ], + result: + "pzprv3/edamame/2/3/. . . /. . . /1 1 0 /16 4 16 /0 0 /0 0 /0 0 0 /" + }, + { + input: ["mouse,right,3,1", "mouse,right,5,1", "mouse,right,5,3"], + result: + "pzprv3/edamame/2/3/. . . /. . . /1 0 16 /16 4 4 /0 0 /0 0 /0 0 0 /" + }, + { + input: [ + "playmode,mark-circle", + "mouse,left,1,3", + "playmode,subcross", + "mouse,left,3,1" + ], + result: + "pzprv3/edamame/2/3/. . . /. . . /1 4 16 /1 4 4 /0 0 /0 0 /0 0 0 /" + }, + { + input: ["playmode,objblank", "mouse,left,3,1,3,3", "mouse,left,5,1,3,1"], + result: + "pzprv3/edamame/2/3/. . . /. . . /1 0 0 /1 16 4 /0 0 /0 0 /0 0 0 /" } ] }); From 64a07eb5521784f90756858cd5367c24d8e1bc19 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Thu, 5 Mar 2026 15:03:58 +0100 Subject: [PATCH 19/25] Reorder fail cases --- test/script/edamame.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/script/edamame.js b/test/script/edamame.js index ab64fba7f..973bbaf21 100644 --- a/test/script/edamame.js +++ b/test/script/edamame.js @@ -4,8 +4,16 @@ ui.debug.addDebugData("edamame", { url: "5/5/0cjcgbiaj", failcheck: [ [ - "laCurve", - "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 0 0 0 /0 0 0 0 0 /3 0 0 0 0 /1 1 3 0 0 /3 0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /1 1 0 0 /0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /1 0 0 0 0 /1 0 0 0 0 /" + "csLt1", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 3 /0 3 0 0 3 /0 1 0 0 0 /0 3 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 1 0 0 1 /0 1 0 0 1 /0 0 0 0 1 /" + ], + [ + "csGt1", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 0 0 3 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 0 /0 0 0 0 3 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 1 /" + ], + [ + "cuEndpoint", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 2 /0 3 0 0 3 /0 1 0 0 1 /0 3 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 1 0 0 1 /0 1 0 0 1 /0 0 0 0 1 /" ], [ "nmShadeGt", @@ -16,28 +24,20 @@ ui.debug.addDebugData("edamame", { "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 3 /0 0 0 0 3 /0 0 0 0 1 /0 0 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 1 /" ], [ - "csLt1", - "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 3 /0 3 0 0 3 /0 1 0 0 0 /0 3 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 1 0 0 1 /0 1 0 0 1 /0 0 0 0 1 /" + "csNotOnLine", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 3 /0 1 0 0 3 /0 1 0 0 1 /0 0 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 1 /" ], [ "cuDivide", "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 3 /0 3 0 0 3 /0 1 0 0 1 /0 0 0 0 0 /0 3 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 1 0 0 1 /0 1 0 0 1 /0 1 0 0 1 /" ], [ - "ceNoEnd", - "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 1 1 3 /0 3 0 0 3 /0 1 0 4 1 /0 3 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 1 0 0 1 /0 1 0 0 1 /0 0 0 0 1 /" - ], - [ - "csNotOnLine", - "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 3 /0 1 0 0 3 /0 1 0 0 1 /0 0 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 1 /" - ], - [ - "csGt1", - "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 0 0 3 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 0 /0 0 0 0 3 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 1 /0 0 0 0 1 /" + "laCurve", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 0 0 0 /0 0 0 0 0 /3 0 0 0 0 /1 1 3 0 0 /3 0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /1 1 0 0 /0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /1 0 0 0 0 /1 0 0 0 0 /" ], [ - "cuEndpoint", - "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 3 1 2 /0 3 0 0 3 /0 1 0 0 1 /0 3 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 1 0 0 1 /0 1 0 0 1 /0 0 0 0 1 /" + "ceNoEnd", + "pzprv3/edamame/5/5/0 2 . . . /. . . 2 . /. . 1 . . /. . . 0 . /. . . . . /0 0 1 1 3 /0 3 0 0 3 /0 1 0 4 1 /0 3 0 0 0 /0 0 0 0 3 /0 0 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 1 0 0 1 /0 1 0 0 1 /0 0 0 0 1 /" ], [ null, From d2c45ae4e01c8f8b56373ca9d86d4b30a96ae677 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Thu, 5 Mar 2026 15:33:40 +0100 Subject: [PATCH 20/25] Input fix for One Button when clicking on line --- src/variety/kaidan.js | 19 ++++++++++++++++--- test/script/edamame.js | 15 +++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index 1725bed1c..2cadea6ce 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -239,7 +239,13 @@ decIC_edamame: function(cell) { var current = cell.qsub > 0 ? cell.qsub + 1 : cell.qans; var next = this.btn === "left" ? current + 1 : current - 1; - this.inputData = (next + 4) % 4; + next = (next + 4) % 4; + + if (cell.lcnt > 0 && next === 3) { + next = this.btn === "left" ? 0 : 2; + } + + this.inputData = next; }, inputcell: function() { var cell = this.getcell(); @@ -835,14 +841,20 @@ } }, "Graphic@wittgen#2": { - qsubcolor1: "rgb(224, 224, 255)", + qsubcolor1: "rgb(224, 224, 255)" + }, + "Graphic@wittgen,edamame#3": { getBGCellColor: function(cell) { if (cell.error === 1 || cell.qinfo === 1) { return this.errbcolor1; } - if (cell.qsub === 1) { + if ( + (this.pid === "wittgen" && cell.qsub === 1) || + (this.pid === "edamame" && cell.qans === 1) + ) { return this.qsubcolor1; } + if (cell.lcnt === 0) { return null; } @@ -864,6 +876,7 @@ circleratio: [0.25, 0.2], doubleLineWidth: 0.7, qanscolor: "black", + qsubcolor1: "rgba(200, 255, 200, 0.68)", circlestrokecolor: "rgb(0, 160, 0)", getQuesNumberColor: function(cell) { diff --git a/test/script/edamame.js b/test/script/edamame.js index 973bbaf21..f79f10cb6 100644 --- a/test/script/edamame.js +++ b/test/script/edamame.js @@ -97,6 +97,21 @@ ui.debug.addDebugData("edamame", { input: ["playmode,objblank", "mouse,left,3,1,3,3", "mouse,left,5,1,3,1"], result: "pzprv3/edamame/2/3/. . . /. . . /1 0 0 /1 16 4 /0 0 /0 0 /0 0 0 /" + }, + { + input: ["playmode,auto", "mouse,left,1,1,5,1", "mouse,leftx2,3,1"], + result: + "pzprv3/edamame/2/3/. . . /. . . /1 4 0 /1 16 4 /1 1 /0 0 /0 0 0 /" + }, + { + input: ["mouse,left,3,1"], + result: + "pzprv3/edamame/2/3/. . . /. . . /1 0 0 /1 16 4 /1 1 /0 0 /0 0 0 /" + }, + { + input: ["mouse,right,3,1"], + result: + "pzprv3/edamame/2/3/. . . /. . . /1 4 0 /1 16 4 /1 1 /0 0 /0 0 0 /" } ] }); From 6732bb0beec8b58746c2a45c39038c99a43dc5cc Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Thu, 5 Mar 2026 19:42:43 +0100 Subject: [PATCH 21/25] Add background, fix error colors --- src-ui/img/edamame.png | Bin 0 -> 119 bytes src-ui/js/ui/Misc.js | 1 + src/variety/kaidan.js | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 src-ui/img/edamame.png diff --git a/src-ui/img/edamame.png b/src-ui/img/edamame.png new file mode 100644 index 0000000000000000000000000000000000000000..a32ad9070e745e2ba46e9c142ddaa5b432c23b0c GIT binary patch literal 119 zcmeAS@N?(olHy`uVBq!ia0vp^AT~b-Gmw0xxXuPhF%}28J29*~C-V}>VGHmHarHWC zbl}Qr*B 0) { return this.errbcolor1; } if (cell.adjborder[dir].trial) { From 4ce07c7369654f6be42dd388e10eca27bbeed279 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Fri, 6 Mar 2026 20:31:40 +0100 Subject: [PATCH 22/25] Add multiple rightclick inputs --- src/variety/kaidan.js | 26 ++++++++++++++++++-------- test/script/edamame.js | 11 +++++++++++ 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index b8918030d..a817592f9 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -31,7 +31,7 @@ this.inputData = cell.qans !== 1 ? 1 : 0; } else if (this.inputMode === "subcross") { this.inputData = cell.qsub !== 1 ? 2 : 0; - } else if (this.pid === "edamame" && this.puzzle.getConfig("use") === 2) { + } else if (this.pid === "edamame") { this.decIC_edamame(cell); } else { this.common.decIC.call(this, cell); @@ -237,15 +237,25 @@ this.inputFixedQsub(2); }, decIC_edamame: function(cell) { - var current = cell.qsub > 0 ? cell.qsub + 1 : cell.qans; - var next = this.btn === "left" ? current + 1 : current - 1; - next = (next + 4) % 4; + if (this.puzzle.getConfig("use") === 1) { + if (this.btn === "left") { + this.inputData = cell.qans !== 1 ? 1 : 0; + } else if (cell.qsub === 1) { + this.inputData = cell.lcnt > 0 ? 0 : 3; + } else { + this.inputData = cell.qsub === 2 ? 0 : 2; + } + } else { + var current = cell.qsub > 0 ? cell.qsub + 1 : cell.qans; + var next = this.btn === "left" ? current + 1 : current - 1; + next = (next + 4) % 4; - if (cell.lcnt > 0 && next === 3) { - next = this.btn === "left" ? 0 : 2; - } + if (cell.lcnt > 0 && next === 3) { + next = this.btn === "left" ? 0 : 2; + } - this.inputData = next; + this.inputData = next; + } }, inputcell: function() { var cell = this.getcell(); diff --git a/test/script/edamame.js b/test/script/edamame.js index f79f10cb6..326e8f41b 100644 --- a/test/script/edamame.js +++ b/test/script/edamame.js @@ -112,6 +112,17 @@ ui.debug.addDebugData("edamame", { input: ["mouse,right,3,1"], result: "pzprv3/edamame/2/3/. . . /. . . /1 4 0 /1 16 4 /1 1 /0 0 /0 0 0 /" + }, + { + input: [ + "setconfig,use,1", + "mouse,right,3,1", + "mouse,right,3,3", + "mouse,right,5,3", + "mouse,left,1,3" + ], + result: + "pzprv3/edamame/2/3/. . . /. . . /1 0 0 /0 0 16 /1 1 /0 0 /0 0 0 /" } ] }); From 9e773ad61ad0b36942ddb9b3887a21a49b51c57d Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sun, 8 Mar 2026 13:12:12 +0100 Subject: [PATCH 23/25] Fix cycle after drag --- src/variety/kaidan.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index a817592f9..145f3193c 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -45,13 +45,14 @@ // Copy dots this.isDraggingBG = 2; this.inputData = 2; + this.initFirstCell(this.getcell()); } else { this.isDraggingBG = 0; } } if (this.isDraggingBG === 2 && this.mouseend && this.notInputted()) { var cell = this.getcell(); - if (!cell.isnull) { + if (!cell.isnull && cell === this.firstCell) { cell.setQsub(0); cell.draw(); } From 39a3df424e9d901952d7c7ad88a15617bf08c254 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Wed, 11 Mar 2026 17:57:19 +0100 Subject: [PATCH 24/25] Final fix --- src/variety/kaidan.js | 12 ++++++++++++ test/script/edamame.js | 15 +++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/variety/kaidan.js b/src/variety/kaidan.js index 145f3193c..80f084d0c 100644 --- a/src/variety/kaidan.js +++ b/src/variety/kaidan.js @@ -71,6 +71,18 @@ } if (this.btn === "right") { + if ( + this.pid === "edamame" && + this.firstCell && + this.firstCell.isNum() + ) { + var cell = this.getcell(); + if (!cell.isnull && !cell.isNum()) { + this.firstCell = cell; + this.inputData = null; + } + } + this.inputdragcross(); } else { this.inputLine(); diff --git a/test/script/edamame.js b/test/script/edamame.js index 326e8f41b..5e7898e3b 100644 --- a/test/script/edamame.js +++ b/test/script/edamame.js @@ -123,6 +123,21 @@ ui.debug.addDebugData("edamame", { ], result: "pzprv3/edamame/2/3/. . . /. . . /1 0 0 /0 0 16 /1 1 /0 0 /0 0 0 /" + }, + { + input: [ + "newboard,2,2", + "editmode", + "key,1", + "playmode,auto", + "setconfig,use,1", + "mouse,right,1,1,3,1,3,3" + ], + result: "pzprv3/edamame/2/2/1 . /. . /0 4 /0 4 /0 /0 /0 0 /" + }, + { + input: ["mouse,right,1,1,3,1,3,3"], + result: "pzprv3/edamame/2/2/1 . /. . /0 16 /0 16 /0 /0 /0 0 /" } ] }); From ecfc57f6773efd029fcb95b03784c2e1c8df0d82 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sun, 15 Mar 2026 18:37:55 +0100 Subject: [PATCH 25/25] Cleanup --- src/puzzle/Operation.js | 2 -- src/puzzle/Piece.js | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/puzzle/Operation.js b/src/puzzle/Operation.js index 0bcccbc73..71023f6d5 100644 --- a/src/puzzle/Operation.js +++ b/src/puzzle/Operation.js @@ -72,13 +72,11 @@ pzpr.classmgr.makeCommon({ U: "ques", N: "qnum", Z: "qnum2", - // R is "qnums" C: "qchar", M: "anum", D: "qdir", A: "qans", S: "qsub", - E: "qsub2", K: "qcmp", B: "snum", L: "line" diff --git a/src/puzzle/Piece.js b/src/puzzle/Piece.js index 5ffda7b85..9c3197fe9 100644 --- a/src/puzzle/Piece.js +++ b/src/puzzle/Piece.js @@ -35,7 +35,6 @@ pzpr.classmgr.makeCommon({ /* 補助データを保持するプロパティ */ qsub: 0, // cell :(1:白マス 1-2:背景色/○× 3:絵になる部分) - qsub2: 0, // border:(1:補助線 2:× 11-14:方向記号) qcmp: 0, // cell :(1:cmpマス 1-2:○×) snum: -1, // cell :補助数字を保持する @@ -56,7 +55,7 @@ pzpr.classmgr.makeCommon({ "qnums" ], propans: ["qans", "anum", "line", "trial"], - propsub: ["qsub", "qsub2", "qcmp", "snum"], + propsub: ["qsub", "qcmp", "snum"], propinfo: ["error", "qinfo"], propnorec: { color: 1, error: 1, qinfo: 1 }, @@ -115,9 +114,6 @@ pzpr.classmgr.makeCommon({ setQsub: function(val) { this.setdata("qsub", val); }, - setQsub2: function(val) { - this.setdata("qsub2", val); - }, setQcmp: function(val) { this.setdata("qcmp", val); },