Skip to content

Commit bebe7ef

Browse files
authored
Add Hamle Paths
1 parent ce66459 commit bebe7ef

8 files changed

Lines changed: 113 additions & 15 deletions

File tree

src-ui/changes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
<main>
3434
<div style="margin-bottom: 5px;"><b>Latest types</b> (<em><a href="/list.html" target="_parent">all types</a></em>)</div>
3535
<ul>
36+
<li><a href="/p?hamlepaths" target="_parent">Hamle Paths</a></li>
3637
<li><a href="/p?ruleofthree" target="_parent">Rule of Three</a></li>
3738
<li><a href="/p?disco" target="_parent">Disconnection ディスコネクション</a></li>
3839
<li><a href="/p?nuriloop" target="_parent">Nurikabe Loop 面積リンク</a></li>
3940
<li><a href="/p?roboticwalk" target="_parent">Robotic Walk</a></li>
4041
<li><a href="/p?bramble" target="_parent">Bramble</a></li>
4142
<li><a href="/p?suguru" target="_parent">Suguru (Capsules) ナンバーブロック</a></li>
42-
<li><a href="/p?topo" target="_parent">Topo</a></li>
4343
</ul>
4444
</main>
4545
</body>

src-ui/img/hamlepaths.png

155 Bytes
Loading

src-ui/js/ui/KeyPopup.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ ui.keypopup = {
6969
bonsan: [10, 0],
7070
heyabon: [10, 0],
7171
rectslider: [10, 0],
72+
hamlepaths: [10, 0],
7273
satogaeri: [10, 0],
7374
yosenabe: [10, 0],
7475
herugolf: [10, 0],
@@ -496,6 +497,7 @@ ui.keypopup = {
496497
cap = "□";
497498
} else if (
498499
pid === "rectslider" ||
500+
pid === "hamlepaths" ||
499501
pid === "aquapelago" ||
500502
pid === "mrtile"
501503
) {

src-ui/js/ui/Misc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ function toBGimage(pid) {
152152
"firewalk",
153153
"forestwalk",
154154
"geradeweg",
155+
"hamlepaths",
155156
"hasunomura",
156157
"heteromino",
157158
"heyapin",

src-ui/list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
273273
<li data-pid="brownies"></li>
274274
<li data-pid="timebomb"></li>
275275
<li data-pid="blindrush"></li>
276+
<li data-pid="hamlepaths"></li>
276277
</ul>
277278
</div>
278279
<div class="lists divides">

src/pzpr/variety.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@
187187
guidearrow: [0, 0, "ガイドアロー", "Guide Arrow"],
188188
haisu: [0, 0, "Haisu", "Haisu"],
189189
hakoiri: [1, 0, "はこいり○△□", "Hakoiri-masashi"],
190+
hamlepaths: [0, 0, "Hamle Paths", "Hamle Paths", "bonsan"],
190191
hanare: [0, 0, "はなれ組", "Hanare-gumi", "hanare"],
191192
hashikake: [
192193
0,

src/variety/bonsan.js

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
} else {
88
pzpr.classmgr.makeCustom(pidlist, classbase);
99
}
10-
})(["bonsan", "heyabon", "rectslider", "satogaeri", "timebomb"], {
10+
})(["bonsan", "heyabon", "rectslider", "satogaeri", "timebomb", "hamlepaths"], {
1111
//---------------------------------------------------------
1212
// マウス入力系
1313
"MouseEvent@bonsan,heyabon": {
@@ -22,7 +22,7 @@
2222
play: ["line", "clear", "completion"]
2323
}
2424
},
25-
"MouseEvent@rectslider": {
25+
"MouseEvent@rectslider,hamlepaths": {
2626
inputModes: {
2727
edit: ["number", "clear"],
2828
play: ["line", "bgcolor", "subcircle", "subcross", "clear"]
@@ -123,7 +123,11 @@
123123
}
124124

125125
var puzzle = this.puzzle;
126-
if (puzzle.pid !== "rectslider" && this.inputdark(cell, 1)) {
126+
if (
127+
puzzle.pid !== "rectslider" &&
128+
puzzle.pid !== "hamlepaths" &&
129+
this.inputdark(cell, 1)
130+
) {
127131
return;
128132
}
129133
if (puzzle.pid === "satogaeri") {
@@ -522,10 +526,22 @@
522526
this.setEdgeByNodeObj(border.sidecell[1]);
523527
}
524528
},
529+
"AreaUnshadeGraph@hamlepaths": {
530+
enabled: true,
531+
relation: { "cell.qnum": "node", "border.line": "move" },
532+
isnodevalid: function(cell) {
533+
return cell.base.qnum === -1;
534+
},
535+
536+
modifyOtherInfo: function(border, relation) {
537+
this.setEdgeByNodeObj(border.sidecell[0]);
538+
this.setEdgeByNodeObj(border.sidecell[1]);
539+
}
540+
},
525541

526542
//---------------------------------------------------------
527543
// 画像表示系
528-
"Graphic@bonsan,heyabon,rectslider": {
544+
"Graphic@bonsan,heyabon,rectslider,hamlepaths": {
529545
bgcellcolor_func: "qsub2",
530546
autocmp: "number"
531547
},
@@ -576,11 +592,13 @@
576592
this.drawTarget();
577593
}
578594
},
579-
"Graphic@rectslider": {
595+
"Graphic@rectslider,hamlepaths": {
580596
fontShadecolor: "white",
581597
qcmpcolor: "gray",
582598

583599
paint: function() {
600+
this.drawBGCells();
601+
584602
this.drawDashedGrid();
585603

586604
this.drawTip();
@@ -607,12 +625,7 @@
607625
}
608626

609627
var info = cell.error || cell.qinfo;
610-
if (info === 0) {
611-
return this.quescolor;
612-
} else if (info === 1) {
613-
return this.errcolor1;
614-
}
615-
return null;
628+
return info > 0 ? this.errcolor1 : this.quescolor;
616629
},
617630
getQuesNumberColor: function(cell) {
618631
return cell.isCmp() ? this.qcmpcolor : this.fontShadecolor;
@@ -758,7 +771,7 @@
758771
this.fio.encodeQnum_PBox_Sato();
759772
}
760773
},
761-
"Encode@rectslider,timebomb": {
774+
"Encode@rectslider,timebomb,hamlepaths": {
762775
decodePzpr: function(type) {
763776
this.decodeNumber16();
764777
},
@@ -771,15 +784,23 @@
771784
decodeData: function() {
772785
this.decodeCellQnum();
773786
this.decodeCellQsubQcmp();
774-
if (this.pid !== "rectslider" && this.pid !== "timebomb") {
787+
if (
788+
this.pid !== "rectslider" &&
789+
this.pid !== "timebomb" &&
790+
this.pid !== "hamlepaths"
791+
) {
775792
this.decodeBorderQues();
776793
}
777794
this.decodeBorderLine();
778795
},
779796
encodeData: function() {
780797
this.encodeCellQnum();
781798
this.encodeCellQsubQcmp();
782-
if (this.pid !== "rectslider" && this.pid !== "timebomb") {
799+
if (
800+
this.pid !== "rectslider" &&
801+
this.pid !== "timebomb" &&
802+
this.pid !== "hamlepaths"
803+
) {
783804
this.encodeBorderQues();
784805
}
785806
this.encodeBorderLine();
@@ -890,6 +911,9 @@
890911
"checkMovedBlockRect@rectslider",
891912
"checkMovedBlockSize@rectslider",
892913

914+
"checkMovedAdjacent@hamlepaths",
915+
"checkConnectUnshade@hamlepaths",
916+
893917
"checkLineLength",
894918

895919
"checkFractal@bonsan,heyabon",
@@ -1032,5 +1056,18 @@
10321056
});
10331057
}, "ceNoBomb");
10341058
}
1059+
},
1060+
"AnsCheck@hamlepaths": {
1061+
checkMovedAdjacent: function() {
1062+
this.checkSideCell(function(cell1, cell2) {
1063+
return cell1.base.isNum() && cell2.base.isNum();
1064+
}, "csAdjacent");
1065+
}
1066+
},
1067+
"FailCode@hamlepaths": {
1068+
nmConnected: "nmConnected.rectslider",
1069+
laOnNum: "laOnNum.rectslider",
1070+
laIsolate: "laIsolate.rectslider",
1071+
nmNoMove: "nmNoMove.rectslider"
10351072
}
10361073
});

test/script/hamlepaths.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/* hamlepaths.js */
2+
3+
ui.debug.addDebugData("hamlepaths", {
4+
url: "5/5/h2j1g10m3h.h2",
5+
failcheck: [
6+
[
7+
"brNoLine",
8+
"pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /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 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 0 /"
9+
],
10+
[
11+
"lnBranch",
12+
"pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /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 0 /1 1 1 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 0 0 /"
13+
],
14+
[
15+
"lnCross",
16+
"pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /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 0 /0 0 0 0 /1 1 1 0 /0 0 0 0 /0 1 0 0 0 /0 1 0 0 0 /0 1 0 0 0 /0 1 0 0 0 /"
17+
],
18+
[
19+
"nmConnected",
20+
"pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /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 0 /0 0 0 0 /0 0 0 0 /0 1 1 1 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /"
21+
],
22+
[
23+
"laOnNum",
24+
"pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /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 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 /"
25+
],
26+
[
27+
"laCurve",
28+
"pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /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 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 0 0 0 0 /"
29+
],
30+
[
31+
"laIsolate",
32+
"pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /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 1 0 0 /0 0 0 0 /0 0 0 0 /1 1 0 0 /1 0 1 1 /0 0 0 1 0 /0 0 1 1 1 /0 0 0 1 0 /0 0 0 0 0 /"
33+
],
34+
[
35+
"nmNoMove",
36+
"pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /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 1 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /1 0 1 1 /0 0 0 0 1 /0 0 1 0 0 /0 0 0 0 0 /0 0 0 0 0 /"
37+
],
38+
[
39+
"laLenNe",
40+
"pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /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 1 0 0 /0 0 1 0 /0 0 0 0 /0 0 1 0 /1 0 0 1 /0 0 0 0 0 /0 0 0 0 1 /0 0 0 0 0 /0 0 0 0 0 /"
41+
],
42+
[
43+
"csAdjacent",
44+
"pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /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 1 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /1 0 1 1 /0 0 0 1 1 /0 0 1 1 0 /0 0 0 1 0 /0 0 0 0 0 /"
45+
],
46+
[
47+
"cuDivide",
48+
"pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /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 1 0 0 /0 1 0 0 /0 0 0 0 /0 0 0 0 /1 0 1 1 /0 0 0 1 0 /0 0 0 1 1 /0 0 0 1 0 /0 0 0 0 0 /"
49+
],
50+
[
51+
null,
52+
"pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /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 1 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /1 0 1 1 /0 0 0 1 0 /0 0 1 1 1 /0 0 0 1 0 /0 0 0 0 0 /"
53+
]
54+
],
55+
inputs: []
56+
});

0 commit comments

Comments
 (0)