Skip to content

Commit 12c6b97

Browse files
authored
Add Hasu no Mura
2 parents 0c18d2e + d76620f commit 12c6b97

File tree

9 files changed

+75
-6
lines changed

9 files changed

+75
-6
lines changed

src-ui/changes.html

Lines changed: 2 additions & 2 deletions
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?hasunomura" target="_parent">Hasu no Mura はすのむら</a></li>
37+
<li><a href="/p?tetroctb" target="_parent">Tetro Chain-CTB テトロチェーンCTB</a></li>
3638
<li><a href="/p?edamame" target="_parent">Edamame</a></li>
3739
<li><a href="/p?marutaring" target="_parent">Marutaring マルタリング</a></li>
3840
<li><a href="/p?heavydots" target="_parent">Heavy Dots</a></li>
3941
<li><a href="/p?bhaibahan" target="_parent">Bhai Bahan</a></li>
4042
<li><a href="/p?oasis" target="_parent">Oasis</a></li>
41-
<li><a href="/p?circuitwalk" target="_parent">Circuit Walk</a></li>
42-
<li><a href="/p?cornerch" target="_parent">Corner Chain 隅角チェーン</a></li>
4343
</ul>
4444
</main>
4545
</body>

src-ui/img/hasunomura.png

142 Bytes
Loading

src-ui/js/ui/KeyPopup.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ ui.keypopup = {
249249
edamame: [4, 0],
250250
heavydots: [10, 0],
251251
marutaring: [10, 0],
252-
tetroctb: [10, 0]
252+
tetroctb: [10, 0],
253+
hasunomura: [10, 0]
253254
},
254255

255256
//---------------------------------------------------------------------------

src-ui/js/ui/Misc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ function toBGimage(pid) {
150150
"firewalk",
151151
"forestwalk",
152152
"geradeweg",
153+
"hasunomura",
153154
"heteromino",
154155
"heyapin",
155156
"icewalk",

src-ui/list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
7272
<li data-pid="tetrochaink"></li>
7373
<li data-pid="sansaroad"></li>
7474
<li data-pid="cornerch"></li>
75+
<li data-pid="hasunomura"></li>
7576
</ul>
7677
</div>
7778
<div class="lists blocks">

src/pzpr/variety.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@
194194
"",
195195
{ pzprurl: "hashi", kanpen: "hashi", alias: "bridges" }
196196
],
197+
hasunomura: [0, 0, "はすのむら", "Hasu no Mura", "nurikabe"],
197198
heavydots: [0, 0, "Heavy Dots", "Heavy Dots"],
198199
hebi: [1, 0, "へびいちご", "Hebi-Ichigo", "", { old: "snakes" }],
199200
herugolf: [0, 0, "ヘルゴルフ", "Herugolf"],

src/res/failcode.en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@
312312
"bkSizeNe.cbanana": "The number is not equal to the size of the area.",
313313
"bkSizeNe.fillmat": "The number is different from the size of the tatami.",
314314
"bkSizeNe.hanare": "The size of the room is not equal to the number.",
315+
"bkSizeNe.hasunomura": "The sum of the size of the diagonally adjacent blocks is not equal to the number.",
315316
"bkSizeNe.nurikabe": "The number is not equal to the size of the area.",
316317
"bkSizeNe.putteria": "The size of the room is not equal to the number.",
317318
"bkSizeNe.scrin": "The size of the area is not equal to the number.",

src/variety/nurikabe.js

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"mochinyoro",
1616
"canal",
1717
"norinuri",
18-
"cornerch"
18+
"cornerch",
19+
"hasunomura"
1920
],
2021
{
2122
//---------------------------------------------------------
@@ -26,7 +27,7 @@
2627
autoedit_func: "qnum",
2728
autoplay_func: "cell"
2829
},
29-
"MouseEvent@nurikabe": {
30+
"MouseEvent@nurikabe,hasunomura": {
3031
inputModes: {
3132
edit: ["number", "clear", "info-blk"],
3233
play: ["shade", "unshade", "info-blk"]
@@ -239,7 +240,7 @@
239240
this.drawTarget();
240241
}
241242
},
242-
"Graphic@nuribou,mochikoro,mochinyoro,norinuri,cornerch": {
243+
"Graphic@nuribou,mochikoro,mochinyoro,norinuri,cornerch,hasunomura": {
243244
bgcellcolor_func: "qsub1",
244245
enablebcolor: true
245246
},
@@ -431,6 +432,15 @@
431432
"doneShadingDecided"
432433
]
433434
},
435+
"AnsCheck@hasunomura#1": {
436+
checklist: [
437+
"checkShadeCellExist",
438+
"check2x2ShadeCell",
439+
"checkDiagonalSums",
440+
"checkConnectShade",
441+
"doneShadingDecided"
442+
]
443+
},
434444
AnsCheck: {
435445
checkDoubleNumberInUnshade: function() {
436446
this.checkAllBlock(
@@ -615,6 +625,32 @@
615625
);
616626
}
617627
},
628+
"AnsCheck@hasunomura": {
629+
checkDiagonalSums: function() {
630+
this.checkAllCell(function(cell) {
631+
if (!cell.isValidNum()) {
632+
return false;
633+
}
634+
635+
var set = new Set();
636+
for (var dy = -2; dy <= 2; dy += 4) {
637+
for (var dx = -2; dx <= 2; dx += 4) {
638+
var room = cell.relcell(dx, dy).ublk;
639+
if (room) {
640+
set.add(room);
641+
}
642+
}
643+
}
644+
645+
var count = 0;
646+
set.forEach(function(block) {
647+
count += block.clist.length;
648+
});
649+
650+
return cell.getNum() !== count;
651+
}, "bkSizeNe");
652+
}
653+
},
618654
"FailCode@mochikoro,mochinyoro": {
619655
cuNotRect: "cuNotRect.mochikoro",
620656
csRect: "csRect.mochikoro",

test/script/hasunomura.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* hasunomura.js */
2+
3+
ui.debug.addDebugData("hasunomura", {
4+
url: "6/6/g2l2j2h5n6k6j",
5+
failcheck: [
6+
[
7+
"brNoShade",
8+
"pzprv3/hasunomura/6/6/. 2 . . . . /. . 2 . . . /. 2 . . 5 . /. . . . . . /. 6 . . . . /. 6 . . . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /"
9+
],
10+
[
11+
"cs2x2",
12+
"pzprv3/hasunomura/6/6/. 2 . . . . /. . 2 . . . /. 2 . . 5 . /. . . . . . /. 6 . . . . /. 6 . . . . /# . # # # # /# # . . # # /# . # # . # /# . . . . # /. . . . . . /. . . . . . /"
13+
],
14+
[
15+
"bkSizeNe",
16+
"pzprv3/hasunomura/6/6/. 2 . . . . /. . 2 . . . /. 2 . . 5 . /. . . . . . /. 6 . . . . /. 6 . . . . /# . # # # # /# # . # . # /# . # # . # /# # # . . # /. . # # . # /. . . . # # /"
17+
],
18+
[
19+
"csDivide",
20+
"pzprv3/hasunomura/6/6/. 2 . . . . /. . 2 . . . /. 2 . . 5 . /. . . . . . /. 6 . . . . /. 6 . . . . /# . # # # . /# # . . # # /# . # # . # /# # # . . # /# . . # # # /. . . . # . /"
21+
],
22+
[
23+
null,
24+
"pzprv3/hasunomura/6/6/. 2 . . . . /. . 2 . . . /. 2 . . 5 . /. . . . . . /. 6 . . . . /. 6 . . . . /# + # # # + /# # + + # # /# + # # + # /# # # + + # /+ + # # # # /+ + + + # + /"
25+
]
26+
],
27+
inputs: [] /* nurikabeと同じなので省略 */
28+
});

0 commit comments

Comments
 (0)