Skip to content
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,13 +33,13 @@
<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?hamlepaths" target="_parent">Hamle Paths</a></li>
<li><a href="/p?ruleofthree" target="_parent">Rule of Three</a></li>
<li><a href="/p?disco" target="_parent">Disconnection ディスコネクション</a></li>
<li><a href="/p?nuriloop" target="_parent">Nurikabe Loop 面積リンク</a></li>
<li><a href="/p?roboticwalk" target="_parent">Robotic Walk</a></li>
<li><a href="/p?bramble" target="_parent">Bramble</a></li>
<li><a href="/p?suguru" target="_parent">Suguru (Capsules) ナンバーブロック</a></li>
<li><a href="/p?topo" target="_parent">Topo</a></li>
</ul>
</main>
</body>
Binary file added src-ui/img/hamlepaths.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src-ui/js/ui/KeyPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ ui.keypopup = {
bonsan: [10, 0],
heyabon: [10, 0],
rectslider: [10, 0],
hamlepaths: [10, 0],
satogaeri: [10, 0],
yosenabe: [10, 0],
herugolf: [10, 0],
Expand Down Expand Up @@ -496,6 +497,7 @@ ui.keypopup = {
cap = "□";
} else if (
pid === "rectslider" ||
pid === "hamlepaths" ||
pid === "aquapelago" ||
pid === "mrtile"
) {
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 @@ -152,6 +152,7 @@ function toBGimage(pid) {
"firewalk",
"forestwalk",
"geradeweg",
"hamlepaths",
"hasunomura",
"heteromino",
"heyapin",
Expand Down
1 change: 1 addition & 0 deletions src-ui/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
<li data-pid="brownies"></li>
<li data-pid="timebomb"></li>
<li data-pid="blindrush"></li>
<li data-pid="hamlepaths"></li>
</ul>
</div>
<div class="lists divides">
Expand Down
1 change: 1 addition & 0 deletions src/pzpr/variety.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
guidearrow: [0, 0, "ガイドアロー", "Guide Arrow"],
haisu: [0, 0, "Haisu", "Haisu"],
hakoiri: [1, 0, "はこいり○△□", "Hakoiri-masashi"],
hamlepaths: [0, 0, "Hamle Paths", "Hamle Paths", "bonsan"],
hanare: [0, 0, "はなれ組", "Hanare-gumi", "hanare"],
hashikake: [
0,
Expand Down
65 changes: 51 additions & 14 deletions src/variety/bonsan.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
} else {
pzpr.classmgr.makeCustom(pidlist, classbase);
}
})(["bonsan", "heyabon", "rectslider", "satogaeri", "timebomb"], {
})(["bonsan", "heyabon", "rectslider", "satogaeri", "timebomb", "hamlepaths"], {
//---------------------------------------------------------
// マウス入力系
"MouseEvent@bonsan,heyabon": {
Expand All @@ -22,7 +22,7 @@
play: ["line", "clear", "completion"]
}
},
"MouseEvent@rectslider": {
"MouseEvent@rectslider,hamlepaths": {
inputModes: {
edit: ["number", "clear"],
play: ["line", "bgcolor", "subcircle", "subcross", "clear"]
Expand Down Expand Up @@ -123,7 +123,11 @@
}

var puzzle = this.puzzle;
if (puzzle.pid !== "rectslider" && this.inputdark(cell, 1)) {
if (
puzzle.pid !== "rectslider" &&
puzzle.pid !== "hamlepaths" &&
this.inputdark(cell, 1)
) {
return;
}
if (puzzle.pid === "satogaeri") {
Expand Down Expand Up @@ -522,10 +526,22 @@
this.setEdgeByNodeObj(border.sidecell[1]);
}
},
"AreaUnshadeGraph@hamlepaths": {
enabled: true,
relation: { "cell.qnum": "node", "border.line": "move" },
isnodevalid: function(cell) {
return cell.base.qnum === -1;
},

modifyOtherInfo: function(border, relation) {
this.setEdgeByNodeObj(border.sidecell[0]);
this.setEdgeByNodeObj(border.sidecell[1]);
}
},

//---------------------------------------------------------
// 画像表示系
"Graphic@bonsan,heyabon,rectslider": {
"Graphic@bonsan,heyabon,rectslider,hamlepaths": {
bgcellcolor_func: "qsub2",
autocmp: "number"
},
Expand Down Expand Up @@ -576,11 +592,13 @@
this.drawTarget();
}
},
"Graphic@rectslider": {
"Graphic@rectslider,hamlepaths": {
fontShadecolor: "white",
qcmpcolor: "gray",

paint: function() {
this.drawBGCells();

this.drawDashedGrid();

this.drawTip();
Expand All @@ -607,12 +625,7 @@
}

var info = cell.error || cell.qinfo;
if (info === 0) {
return this.quescolor;
} else if (info === 1) {
return this.errcolor1;
}
return null;
return info > 0 ? this.errcolor1 : this.quescolor;
},
getQuesNumberColor: function(cell) {
return cell.isCmp() ? this.qcmpcolor : this.fontShadecolor;
Expand Down Expand Up @@ -758,7 +771,7 @@
this.fio.encodeQnum_PBox_Sato();
}
},
"Encode@rectslider,timebomb": {
"Encode@rectslider,timebomb,hamlepaths": {
decodePzpr: function(type) {
this.decodeNumber16();
},
Expand All @@ -771,15 +784,23 @@
decodeData: function() {
this.decodeCellQnum();
this.decodeCellQsubQcmp();
if (this.pid !== "rectslider" && this.pid !== "timebomb") {
if (
this.pid !== "rectslider" &&
this.pid !== "timebomb" &&
this.pid !== "hamlepaths"
) {
this.decodeBorderQues();
}
this.decodeBorderLine();
},
encodeData: function() {
this.encodeCellQnum();
this.encodeCellQsubQcmp();
if (this.pid !== "rectslider" && this.pid !== "timebomb") {
if (
this.pid !== "rectslider" &&
this.pid !== "timebomb" &&
this.pid !== "hamlepaths"
) {
this.encodeBorderQues();
}
this.encodeBorderLine();
Expand Down Expand Up @@ -890,6 +911,9 @@
"checkMovedBlockRect@rectslider",
"checkMovedBlockSize@rectslider",

"checkMovedAdjacent@hamlepaths",
"checkConnectUnshade@hamlepaths",

"checkLineLength",

"checkFractal@bonsan,heyabon",
Expand Down Expand Up @@ -1032,5 +1056,18 @@
});
}, "ceNoBomb");
}
},
"AnsCheck@hamlepaths": {
checkMovedAdjacent: function() {
this.checkSideCell(function(cell1, cell2) {
return cell1.base.isNum() && cell2.base.isNum();
}, "csAdjacent");
}
},
"FailCode@hamlepaths": {
nmConnected: "nmConnected.rectslider",
laOnNum: "laOnNum.rectslider",
laIsolate: "laIsolate.rectslider",
nmNoMove: "nmNoMove.rectslider"
}
});
56 changes: 56 additions & 0 deletions test/script/hamlepaths.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* hamlepaths.js */

ui.debug.addDebugData("hamlepaths", {
url: "5/5/h2j1g10m3h.h2",
failcheck: [
[
"brNoLine",
"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 /"
],
[
"lnBranch",
"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 /"
],
[
"lnCross",
"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 /"
],
[
"nmConnected",
"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 /"
],
[
"laOnNum",
"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 /"
],
[
"laCurve",
"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 /"
],
[
"laIsolate",
"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 /"
],
[
"nmNoMove",
"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 /"
],
[
"laLenNe",
"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 /"
],
[
"csAdjacent",
"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 /"
],
[
"cuDivide",
"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 /"
],
[
null,
"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 /"
]
],
inputs: []
});
Loading