Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Water Walk #474

Merged
merged 7 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src-ui/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
<main>
<div style="margin-bottom: 5px;"><b>Latest types</b> (<em><a href="/list.html" target="_parent">all types</a></em>)</div>
<ul>
<li><a href="/p?waterwalk" target="_parent">Water Walk</a></li>
<li><a href="/p?patchwork" target="_parent">Patchwork パッチワーク</a></li>
<li><a href="/p?myopia" target="_parent">Myopia</a></li>
<li><a href="/p?sashikazune" target="_parent">Sashikazune さしカズね</a></li>
<li><a href="/p?brownies" target="_parent">Brownies ブラウニー</a></li>
<li><a href="/p?tetrochain" target="_parent">Tetrochain テトロチェーン</a></li>
<li><a href="/p?bdwalk" target="_parent">Building Walk ビルウォーク <small>(rules update)</small></a></li>
<li><a href="/p?heyapin" target="_parent">Heyapin へやピン</a></li>
<li><a href="/p?invlitso" target="_parent">Inverse LITSO</a></li>
</ul>
</main>
</body>
Binary file added src-ui/img/waterwalk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src-ui/js/ui/KeyPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ ui.keypopup = {
tetrochain: [10, 0],
brownies: [127, 0],
sashikazune: [10, 0],
patchwork: [10, 0]
patchwork: [10, 0],
waterwalk: [10, 0]
},

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -433,6 +434,7 @@ ui.keypopup = {
pid === "icelom" ||
pid === "icelom2" ||
pid === "icewalk" ||
pid === "waterwalk" ||
pid === "dbchoco"
) {
itemlist.push([
Expand Down
1 change: 1 addition & 0 deletions src-ui/js/ui/Misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ function toBGimage(pid) {
"voxas",
"vslither",
"walllogic",
"waterwalk",
"yinyang"
];
if (imgs.indexOf(pid) >= 0) {
Expand Down
1 change: 1 addition & 0 deletions src-ui/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
<li data-pid="remlen"></li>
<li data-pid="nanameguri"></li>
<li data-pid="myopia"></li>
<li data-pid="waterwalk"></li>
</ul>
</div>
<div class="lists loops">
Expand Down
1 change: 1 addition & 0 deletions src/pzpr/variety.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,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: [
Expand Down
1 change: 1 addition & 0 deletions src/res/failcode.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,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.",
Expand Down
43 changes: 35 additions & 8 deletions src/variety/icewalk.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
} else {
pzpr.classmgr.makeCustom(pidlist, classbase);
}
})(["icewalk"], {
})(["icewalk", "waterwalk"], {
MouseEvent: {
inputModes: {
edit: ["ice", "number", "clear", "info-line"],
Expand Down Expand Up @@ -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,

Expand Down Expand Up @@ -115,8 +126,13 @@
return null;
}
},
"Graphic@waterwalk": {
icecolor: "rgb(163, 216, 255)"
},
LineGraph: {
enabled: true,
enabled: true
},
"LineGraph@icewalk": {
isLineCross: true
},
AreaRoomGraph: {
Expand All @@ -126,11 +142,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: {
Expand Down Expand Up @@ -174,8 +190,10 @@
AnsCheck: {
checklist: [
"checkBranchLine",
"checkCrossOutOfIce",
"checkIceLines",
"checkCrossLine@waterwalk",
"checkCrossOutOfIce@icewalk",
"checkIceLines@icewalk",
"checkWaterWalk@waterwalk",
"checkLessWalk",
"checkOverWalk",

Expand All @@ -190,6 +208,9 @@
checkOverWalk: function() {
this.checkWalkLength(+1, "bkSizeGt");
},
checkWaterWalk: function() {
this.checkWalkLength(+2, "bkSizeGt2");
},

checkWalkLength: function(flag, code) {
if (this.board.roommgr.isStale) {
Expand All @@ -201,6 +222,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;
}
Expand Down
53 changes: 53 additions & 0 deletions test/script/waterwalk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/* waterwalk.js */

ui.debug.addDebugData("waterwalk", {
url: "5/5/660cc5i6s3k6",
failcheck: [
[
"lnBranch",
"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 . # # 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 . # # 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 . # # 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 . # # 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 . # # 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",
"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 . # # 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 . # # 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 . # # 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: [
{
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 /"
}
]
});
Loading