From d3b44a5301a2f72f389e29723408b646fd8d4907 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Wed, 26 Jul 2023 21:06:44 +0200 Subject: [PATCH 1/6] Add Water Walk --- src/pzpr/variety.js | 1 + src/res/failcode.en.json | 1 + src/variety/icewalk.js | 32 ++++++++++++++++++++++++-------- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/pzpr/variety.js b/src/pzpr/variety.js index 9c6cd664a..bd6ccf1e9 100755 --- a/src/pzpr/variety.js +++ b/src/pzpr/variety.js @@ -380,6 +380,7 @@ wafusuma: [0, 0, "和フスマ", "Wafusuma", "fillomino"], wagiri: [0, 0, "ごきげんななめ・輪切", "Wagiri", "gokigen"], walllogic: [0, 0, "ウォールロジック", "Wall Logic"], + waterwalk: [0, 0, "Water Walk", "Water Walk", "icewalk"], wblink: [0, 0, "シロクロリンク", "Shirokuro-link"], yajikazu: [1, 0, "やじさんかずさん", "Yajisan-Kazusan"], yajilin: [ diff --git a/src/res/failcode.en.json b/src/res/failcode.en.json index 4e1cab1fb..02016a87b 100644 --- a/src/res/failcode.en.json +++ b/src/res/failcode.en.json @@ -236,6 +236,7 @@ "bkSizeGt.lightshadow": "A number is smaller than the size of the area.", "bkSizeGt.martini": "A number is smaller than the amount of circles in the area.", "bkSizeGt2.lollipops": "Lollipops are adjacent.", + "bkSizeGt2.waterwalk": "A line goes through 3 or more water cells.", "bkSizeGt2": "The size of an area is larger than two.", "bkSizeGt3": "The size of an area is larger than three.", "bkSizeGt4": "The size of an area is larger than four.", diff --git a/src/variety/icewalk.js b/src/variety/icewalk.js index df2add850..3f3b2edfc 100644 --- a/src/variety/icewalk.js +++ b/src/variety/icewalk.js @@ -4,7 +4,7 @@ } else { pzpr.classmgr.makeCustom(pidlist, classbase); } -})(["icewalk"], { +})(["icewalk", "waterwalk"], { MouseEvent: { inputModes: { edit: ["ice", "number", "clear", "info-line"], @@ -115,8 +115,13 @@ return null; } }, + "Graphic@waterwalk": { + icecolor: "rgb(163, 216, 255)" + }, LineGraph: { - enabled: true, + enabled: true + }, + "LineGraph@icewalk": { isLineCross: true }, AreaRoomGraph: { @@ -126,11 +131,11 @@ "cell.ques": "node", "border.line": "separator" }, - isnodevalid: function(cell) { - return !cell.ice(); - }, isedgevalidbylinkobj: function(border) { - return border.isLine(); + if (!border.isLine()) { + return false; + } + return border.sidecell[0].ice() === border.sidecell[1].ice(); } }, Encode: { @@ -174,8 +179,10 @@ AnsCheck: { checklist: [ "checkBranchLine", - "checkCrossOutOfIce", - "checkIceLines", + "checkCrossLine@waterwalk", + "checkCrossOutOfIce@icewalk", + "checkIceLines@icewalk", + "checkWaterWalk@waterwalk", "checkLessWalk", "checkOverWalk", @@ -190,6 +197,9 @@ checkOverWalk: function() { this.checkWalkLength(+1, "bkSizeGt"); }, + checkWaterWalk: function() { + this.checkWalkLength(+2, "bkSizeGt2"); + }, checkWalkLength: function(flag, code) { if (this.board.roommgr.isStale) { @@ -201,6 +211,12 @@ for (var i = 0; i < this.board.cell.length; i++) { var cell = this.board.cell[i]; var qnum = cell.qnum; + if (flag === +2) { + if (!cell.ice()) { + continue; + } + qnum = 2; + } if (qnum <= 0 || !cell.room) { continue; } From 47db06c254c3c1cf0477c6743bfefff38ce59a6a Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Thu, 27 Jul 2023 21:23:19 +0200 Subject: [PATCH 2/6] Add example --- src-ui/list.html | 1 + test/script/waterwalk.js | 47 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 test/script/waterwalk.js diff --git a/src-ui/list.html b/src-ui/list.html index a44d83b2e..7d6f6b6a9 100644 --- a/src-ui/list.html +++ b/src-ui/list.html @@ -132,6 +132,7 @@

パズルの種類のリスト
  • +
  • diff --git a/test/script/waterwalk.js b/test/script/waterwalk.js new file mode 100644 index 000000000..81bb99138 --- /dev/null +++ b/test/script/waterwalk.js @@ -0,0 +1,47 @@ +/* waterwalk.js */ + +ui.debug.addDebugData("waterwalk", { + url: "5/5/660cc5w3k6", + failcheck: [ + [ + "lnBranch", + "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 0 0 0 0 /0 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 0 0 /1 0 0 0 0 /1 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "lnCross", + "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 0 0 0 0 /0 0 0 0 0 0 /0 0 1 1 0 0 /0 0 0 1 1 0 /0 0 0 0 0 0 /0 0 0 0 0 /0 1 0 0 0 /0 1 1 0 0 /0 0 1 0 1 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "lnCross", + "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 0 0 0 0 0 /0 0 0 0 0 0 /0 0 0 1 0 0 /0 0 1 1 0 0 /0 0 0 1 1 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 1 /0 1 1 1 1 /0 0 1 0 1 /0 0 0 0 0 /" + ], + [ + "bkSizeGt2", + "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 1 0 0 /0 0 0 0 1 0 /0 0 0 0 0 0 /0 0 0 0 0 0 /0 0 0 0 1 0 /0 0 0 0 0 /1 0 0 1 0 /1 0 0 0 1 /1 0 0 0 1 /0 0 0 0 1 /0 0 0 0 0 /" + ], + [ + "bkSizeLt", + "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 0 0 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 0 /1 0 0 0 0 /0 0 1 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "bkSizeGt", + "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /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 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "lnPlLoop", + "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 0 1 0 /0 0 0 0 0 0 /0 1 0 0 1 0 /0 0 1 0 0 0 /0 0 0 0 0 0 /0 0 0 0 0 /1 0 1 1 1 /1 0 1 1 1 /0 1 1 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "lnIsolate", + "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 0 0 0 /0 0 1 0 0 0 /0 0 0 0 0 0 /0 1 0 0 0 0 /0 0 0 0 0 0 /0 0 0 0 0 /1 0 1 0 0 /1 1 0 0 0 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "lnDeadEnd", + "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 1 1 0 /0 0 0 0 0 0 /0 0 0 1 0 0 /0 1 0 1 0 0 /0 0 0 1 1 0 /0 0 0 0 0 /1 0 0 0 1 /1 0 0 0 1 /1 0 0 1 1 /0 0 1 0 1 /0 0 0 0 0 /" + ], + [ + null, + "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 1 1 0 /0 0 1 0 0 0 /0 0 0 1 0 0 /0 1 0 1 0 0 /0 0 0 1 1 0 /0 0 0 0 0 /1 0 0 0 1 /1 1 1 0 1 /1 1 0 1 1 /0 0 1 0 1 /0 0 0 0 0 /" + ] + ] +}); From 2b237066f75217c86115cab4ab9417211c709b87 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sat, 5 Aug 2023 09:47:15 +0200 Subject: [PATCH 3/6] Rename input mode --- src-ui/js/ui/KeyPopup.js | 4 +++- src/variety/icewalk.js | 11 +++++++++++ test/script/waterwalk.js | 6 ++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src-ui/js/ui/KeyPopup.js b/src-ui/js/ui/KeyPopup.js index 2075fd594..0ec4586a8 100644 --- a/src-ui/js/ui/KeyPopup.js +++ b/src-ui/js/ui/KeyPopup.js @@ -179,7 +179,8 @@ ui.keypopup = { detour: [10, 0], maxi: [10, 0], tetrochain: [10, 0], - brownies: [127, 0] + brownies: [127, 0], + waterwalk: [10, 0] }, //--------------------------------------------------------------------------- @@ -426,6 +427,7 @@ ui.keypopup = { pid === "icelom" || pid === "icelom2" || pid === "icewalk" || + pid === "waterwalk" || pid === "dbchoco" ) { itemlist.push([ diff --git a/src/variety/icewalk.js b/src/variety/icewalk.js index 3f3b2edfc..79c690c92 100644 --- a/src/variety/icewalk.js +++ b/src/variety/icewalk.js @@ -39,6 +39,17 @@ } } }, + "MouseEvent@waterwalk": { + inputModes: { + edit: ["water", "number", "clear", "info-line"], + play: ["line", "peke", "info-line"] + }, + mouseinput_other: function() { + if (this.inputMode === "water") { + this.inputIcebarn(); + } + } + }, KeyEvent: { enablemake: true, diff --git a/test/script/waterwalk.js b/test/script/waterwalk.js index 81bb99138..efc2803ae 100644 --- a/test/script/waterwalk.js +++ b/test/script/waterwalk.js @@ -43,5 +43,11 @@ ui.debug.addDebugData("waterwalk", { null, "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 1 1 0 /0 0 1 0 0 0 /0 0 0 1 0 0 /0 1 0 1 0 0 /0 0 0 1 1 0 /0 0 0 0 0 /1 0 0 0 1 /1 1 1 0 1 /1 1 0 1 1 /0 0 1 0 1 /0 0 0 0 0 /" ] + ], + inputs: [ + { + input: ["newboard,2,2", "editmode,water", "mouse,left,1,1,3,1"], + result: "pzprv3/waterwalk/2/2/# # /. . /0 0 0 /0 0 0 /0 0 /0 0 /0 0 /" + } ] }); From d09ab51ce1d5770759a3226d3ab3500f40f7b9ea Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sat, 12 Aug 2023 20:38:24 +0200 Subject: [PATCH 4/6] Add duplicate number to example puzzle --- test/script/waterwalk.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/script/waterwalk.js b/test/script/waterwalk.js index efc2803ae..953b3f016 100644 --- a/test/script/waterwalk.js +++ b/test/script/waterwalk.js @@ -1,31 +1,31 @@ /* waterwalk.js */ ui.debug.addDebugData("waterwalk", { - url: "5/5/660cc5w3k6", + url: "5/5/660cc5i6s3k6", failcheck: [ [ "lnBranch", - "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 0 0 0 0 /0 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 0 0 /1 0 0 0 0 /1 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + "pzprv3/waterwalk/5/5/5 . # # 6 /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 0 0 0 0 /0 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 0 0 /1 0 0 0 0 /1 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" ], [ "lnCross", - "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 0 0 0 0 /0 0 0 0 0 0 /0 0 1 1 0 0 /0 0 0 1 1 0 /0 0 0 0 0 0 /0 0 0 0 0 /0 1 0 0 0 /0 1 1 0 0 /0 0 1 0 1 /0 0 0 0 0 /0 0 0 0 0 /" + "pzprv3/waterwalk/5/5/5 . # # 6 /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 0 0 0 0 /0 0 0 0 0 0 /0 0 1 1 0 0 /0 0 0 1 1 0 /0 0 0 0 0 0 /0 0 0 0 0 /0 1 0 0 0 /0 1 1 0 0 /0 0 1 0 1 /0 0 0 0 0 /0 0 0 0 0 /" ], [ "lnCross", - "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 0 0 0 0 0 /0 0 0 0 0 0 /0 0 0 1 0 0 /0 0 1 1 0 0 /0 0 0 1 1 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 1 /0 1 1 1 1 /0 0 1 0 1 /0 0 0 0 0 /" + "pzprv3/waterwalk/5/5/5 . # # 6 /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 0 0 0 0 0 /0 0 0 0 0 0 /0 0 0 1 0 0 /0 0 1 1 0 0 /0 0 0 1 1 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 1 /0 1 1 1 1 /0 0 1 0 1 /0 0 0 0 0 /" ], [ "bkSizeGt2", - "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 1 0 0 /0 0 0 0 1 0 /0 0 0 0 0 0 /0 0 0 0 0 0 /0 0 0 0 1 0 /0 0 0 0 0 /1 0 0 1 0 /1 0 0 0 1 /1 0 0 0 1 /0 0 0 0 1 /0 0 0 0 0 /" + "pzprv3/waterwalk/5/5/5 . # # 6 /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 1 0 0 /0 0 0 0 1 0 /0 0 0 0 0 0 /0 0 0 0 0 0 /0 0 0 0 1 0 /0 0 0 0 0 /1 0 0 1 0 /1 0 0 0 1 /1 0 0 0 1 /0 0 0 0 1 /0 0 0 0 0 /" ], [ "bkSizeLt", - "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 0 0 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 0 /1 0 0 0 0 /0 0 1 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + "pzprv3/waterwalk/5/5/5 . # # 6 /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 0 0 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 0 /1 0 0 0 0 /0 0 1 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" ], [ "bkSizeGt", - "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /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 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 0 0 0 0 /0 0 0 0 0 /" + "pzprv3/waterwalk/5/5/5 . # # 6 /. . # # . /. . . . . /. # # 3 . /. # # . 6 /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 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 0 0 0 0 /0 0 0 0 0 /" ], [ "lnPlLoop", @@ -33,15 +33,15 @@ ui.debug.addDebugData("waterwalk", { ], [ "lnIsolate", - "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 0 0 0 /0 0 1 0 0 0 /0 0 0 0 0 0 /0 1 0 0 0 0 /0 0 0 0 0 0 /0 0 0 0 0 /1 0 1 0 0 /1 1 0 0 0 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + "pzprv3/waterwalk/5/5/5 . # # 6 /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 0 0 0 /0 0 1 0 0 0 /0 0 0 0 0 0 /0 1 0 0 0 0 /0 0 0 0 0 0 /0 0 0 0 0 /1 0 1 0 0 /1 1 0 0 0 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" ], [ "lnDeadEnd", - "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 1 1 0 /0 0 0 0 0 0 /0 0 0 1 0 0 /0 1 0 1 0 0 /0 0 0 1 1 0 /0 0 0 0 0 /1 0 0 0 1 /1 0 0 0 1 /1 0 0 1 1 /0 0 1 0 1 /0 0 0 0 0 /" + "pzprv3/waterwalk/5/5/5 . # # 6 /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 1 1 0 /0 0 0 0 0 0 /0 0 0 1 0 0 /0 1 0 1 0 0 /0 0 0 1 1 0 /0 0 0 0 0 /1 0 0 0 1 /1 0 0 0 1 /1 0 0 1 1 /0 0 1 0 1 /0 0 0 0 0 /" ], [ null, - "pzprv3/waterwalk/5/5/5 . # # . /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 1 1 0 /0 0 1 0 0 0 /0 0 0 1 0 0 /0 1 0 1 0 0 /0 0 0 1 1 0 /0 0 0 0 0 /1 0 0 0 1 /1 1 1 0 1 /1 1 0 1 1 /0 0 1 0 1 /0 0 0 0 0 /" + "pzprv3/waterwalk/5/5/5 . # # 6 /. . # # . /. . . . . /. # # 3 . /. # # . 6 /0 1 1 1 1 0 /0 0 1 0 0 0 /0 0 0 1 0 0 /0 1 0 1 0 0 /0 0 0 1 1 0 /0 0 0 0 0 /1 0 0 0 1 /1 1 1 0 1 /1 1 0 1 1 /0 0 1 0 1 /0 0 0 0 0 /" ] ], inputs: [ From 36846d896666c71707b09ef55927eb14ec14a311 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sat, 12 Aug 2023 20:44:21 +0200 Subject: [PATCH 5/6] Add background --- src-ui/img/waterwalk.png | Bin 0 -> 118 bytes src-ui/js/ui/Misc.js | 1 + 2 files changed, 1 insertion(+) create mode 100644 src-ui/img/waterwalk.png diff --git a/src-ui/img/waterwalk.png b/src-ui/img/waterwalk.png new file mode 100644 index 0000000000000000000000000000000000000000..00585a39a96347755466d886769d74f14393bbda GIT binary patch literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^{2= 0) { From e36db3d36efb4ebe2387f1b09f2bbdffa09ab4b7 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Mon, 14 Aug 2023 18:50:26 +0200 Subject: [PATCH 6/6] 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 6b8be4e15..1de62e0b4 100644 --- a/src-ui/changes.html +++ b/src-ui/changes.html @@ -33,6 +33,7 @@
    Latest types (all types)