Skip to content

Commit f660f86

Browse files
committed
Add Marutaring
1 parent f379444 commit f660f86

8 files changed

Lines changed: 108 additions & 13 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?marutaring" target="_parent">Marutaring マルタリング</a></li>
3637
<li><a href="/p?oasis" target="_parent">Oasis</a></li>
3738
<li><a href="/p?circuitwalk" target="_parent">Circuit Walk</a></li>
3839
<li><a href="/p?cornerch" target="_parent">Corner Chain 隅角チェーン</a></li>
3940
<li><a href="/p?sendai" target="_parent">Sendai-Miyagi 宮城県仙台市</a></li>
4041
<li><a href="/p?keywest" target="_parent">Key West キーウエスト</a></li>
4142
<li><a href="/p?morningwalk" target="_parent">Morning Walk</a></li>
42-
<li><a href="/p?energywalk" target="_parent">Energy Walk</a></li>
4343
</ul>
4444
</main>
4545
</body>

src-ui/js/ui/KeyPopup.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ ui.keypopup = {
244244
energywalk: [10, 0],
245245
cornerch: [10, 0],
246246
keywest: [4, 4],
247-
oasis: [10, 0]
247+
oasis: [10, 0],
248+
marutaring: [10, 0]
248249
},
249250

250251
//---------------------------------------------------------------------------

src-ui/list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
9999
<li data-pid="kuromenbun"></li>
100100
<li data-pid="tilecity"></li>
101101
<li data-pid="nuritwin"></li>
102+
<li data-pid="marutaring"></li>
102103
</ul>
103104
</div>
104105
<div class="lists blocks">

src/pzpr/variety.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@
278278
makaro: [0, 0, "マカロ", "Makaro"],
279279
mannequin: [0, 0, "マネキンゲート", "Mannequin Gate"],
280280
martini: [0, 0, "マティーニ", "Martini", "shimaguni"],
281+
marutaring: [0, 0, "マルタリング", "Marutaring", "shimaguni"],
281282
mashu: [0, 1, "ましゅ", "Masyu", "", { kanpen: "masyu", alias: "pearl" }],
282283
maxi: [0, 0, "Maxi Loop", "Maxi Loop", "country"],
283284
meander: [0, 0, "にょろにょろナンバー", "Meandering Numbers", "ripple"],

src/res/failcode.en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -915,9 +915,9 @@
915915
"segShort.geradeweg": "A segment is shorter than a number.",
916916
"segUnclued.railpool": "The segment's length isn't in the region's set of numbers.",
917917
"segWhiteUneq.balance": "Segments through a white circle are different.",
918-
"shBranch.bosnianroad": "The loop branches off.",
918+
"shBranch": "The loop branches off.",
919919
"shBranch.snake": "The snake branches off.",
920-
"shDeadEnd.bosnianroad": "There is a dead-end cell.",
920+
"shDeadEnd": "There is a dead-end cell.",
921921
"shDiag.batten": "A checkerboard pattern isn't marked with a clue.",
922922
"shDiag.battleship": "Two ships are diagonally adjacent.",
923923
"shDiag.bosnianroad": "The loop touches itself diagonally.",

src/res/failcode.ja.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,8 @@
802802
"lnAdjacent.pmemory": "線が自分自身と接しています。",
803803
"lnStraightOnIce.firewalk": "線が炎マスを直進しています。",
804804
"nmAdjacent.sananko": "異なるブロックが隣り合っています。",
805-
"shBranch.bosnianroad": "ループが分岐しています。",
806-
"shDeadEnd.bosnianroad": "ループが途切れています。",
805+
"shBranch": "ループが分岐しています。",
806+
"shDeadEnd": "ループが途切れています。",
807807
"shDiag.batten": "2x2の市松模様に塗られる場所に記号がありません。",
808808
"shNoDiag.batten": "記号のある場所で盤面が2x2の市松模様に塗られていません。",
809809
"shNoDiag.pentatouch": "黒点で二つのブロックが接していません。",

src/variety/shimaguni.js

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"heyablock",
1717
"cocktail",
1818
"martini",
19-
"nuritwin"
19+
"nuritwin",
20+
"marutaring"
2021
],
2122
{
2223
//---------------------------------------------------------
@@ -36,7 +37,7 @@
3637
play: ["shade", "unshade", "number"]
3738
}
3839
},
39-
"MouseEvent@cocktail,nuritwin": {
40+
"MouseEvent@cocktail,nuritwin,marutaring": {
4041
inputModes: {
4142
edit: ["border", "number", "clear", "info-blk"],
4243
play: ["shade", "unshade", "info-blk"]
@@ -181,7 +182,7 @@
181182
Board: {
182183
hasborder: 1
183184
},
184-
"Board@shimaguni,stostone,heyablock,cocktail,martini,nuritwin": {
185+
"Board@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring": {
185186
addExtraInfo: function() {
186187
this.stonegraph = this.addInfoList(this.klass.AreaStoneGraph);
187188
}
@@ -303,7 +304,7 @@
303304
"AreaShadeGraph@chocona": {
304305
enabled: true
305306
},
306-
"AreaShadeGraph@nuritwin": {
307+
"AreaShadeGraph@nuritwin,marutaring": {
307308
enabled: true,
308309
coloring: true
309310
},
@@ -315,7 +316,7 @@
315316
component.hinge = null;
316317
}
317318
},
318-
"AreaStoneGraph:AreaShadeGraph@shimaguni,stostone,heyablock,cocktail,martini,nuritwin": {
319+
"AreaStoneGraph:AreaShadeGraph@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring": {
319320
// Same as LITS AreaTetrominoGraph
320321
enabled: true,
321322
relation: { "cell.qans": "node", "border.ques": "separator" },
@@ -375,7 +376,11 @@
375376
this.drawGrid();
376377
}
377378

378-
if (this.pid === "stostone" || this.pid === "nuritwin") {
379+
if (
380+
this.pid === "stostone" ||
381+
this.pid === "nuritwin" ||
382+
this.pid === "marutaring"
383+
) {
379384
this.drawDotCells_stostone();
380385
}
381386
this.drawShadedCells();
@@ -416,7 +421,7 @@
416421
);
417422
}
418423
},
419-
"Graphic@stostone,nuritwin#1": {
424+
"Graphic@stostone,nuritwin,marutaring#1": {
420425
irowakeblk: true,
421426
bgcellcolor_func: "error1",
422427
bcolor: "rgb(80, 204, 80)",
@@ -630,6 +635,18 @@
630635
"doneShadingDecided"
631636
]
632637
},
638+
"AnsCheck@marutaring#1": {
639+
checklist: [
640+
"checkShadeCellExist+",
641+
"check2x2ShadeCell",
642+
"checkShadeRect",
643+
"checkShadeBranch",
644+
"checkNoShadeCellInArea",
645+
"checkShadeCellCount",
646+
"checkConnectShade",
647+
"checkShadeDeadEnd"
648+
]
649+
},
633650
"AnsCheck@shimaguni,stostone,heyablock,cocktail,martini": {
634651
checkSideAreaShadeCell: function() {
635652
this.checkSideAreaCell(
@@ -1006,6 +1023,38 @@
10061023
return Array.from(set);
10071024
}
10081025
},
1026+
"AnsCheck@marutaring": {
1027+
checkNeighborCount: function(sign, error) {
1028+
this.checkAllCell(function(cell) {
1029+
return (
1030+
cell.isShade() &&
1031+
(cell.countDir4Cell(function(adj) {
1032+
return adj.isShade();
1033+
}) -
1034+
2) *
1035+
sign >
1036+
0
1037+
);
1038+
}, error);
1039+
},
1040+
1041+
checkShadeBranch: function() {
1042+
this.checkNeighborCount(+1, "shBranch");
1043+
},
1044+
checkShadeDeadEnd: function() {
1045+
this.checkNeighborCount(-1, "shDeadEnd");
1046+
},
1047+
1048+
checkShadeRect: function() {
1049+
this.checkAllArea(
1050+
this.board.stonegraph,
1051+
function(w, h, a, n) {
1052+
return w * h === a;
1053+
},
1054+
"csNotRect"
1055+
);
1056+
}
1057+
},
10091058

10101059
FailCode: {
10111060
bkShadeDivide: "bkShadeDivide",

test/script/marutaring.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/* marutaring.js */
2+
3+
ui.debug.addDebugData("marutaring", {
4+
url: "5/5/4ccqt2e231g43",
5+
failcheck: [
6+
[
7+
"brNoShade",
8+
"pzprv3/marutaring/5/5/5/0 0 0 1 1 /2 2 2 1 3 /2 2 2 2 3 /2 4 4 4 3 /2 4 4 3 3 /3 . . 1 . /. . . . . /. . . . . /. 3 . . . /. . . 4 . /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /"
9+
],
10+
[
11+
"shBranch",
12+
"pzprv3/marutaring/5/5/5/0 0 0 1 1 /2 2 2 1 3 /2 2 2 2 3 /2 4 4 4 3 /2 4 4 3 3 /3 . . 1 . /. . . . . /. . . . . /. 3 . . . /. . . 4 . /# # # . . /. # . . . /. # . . . /. . . . . /. . . . . /"
13+
],
14+
[
15+
"csNotRect",
16+
"pzprv3/marutaring/5/5/5/0 0 0 1 1 /2 2 2 1 3 /2 2 2 2 3 /2 4 4 4 3 /2 4 4 3 3 /3 . . 1 . /. . . . . /. . . . . /. 3 . . . /. . . 4 . /# # # . . /# . # # # /# # . . # /. # # # # /. . . . . /"
17+
],
18+
[
19+
"bkNoShade",
20+
"pzprv3/marutaring/5/5/5/0 0 0 1 1 /2 2 2 1 3 /2 2 2 2 3 /2 4 4 4 3 /2 4 4 3 3 /3 . . . . /. . . . . /. . . . . /. 2 . . . /. . . . . /# # # . . /# . # . . /# . # . . /# # # . . /. . . . . /"
21+
],
22+
[
23+
"csDivide",
24+
"pzprv3/marutaring/6/6/6/0 0 0 0 0 0 /1 2 2 0 0 0 /1 3 3 0 0 0 /1 3 3 0 0 0 /1 3 3 4 4 4 /1 3 3 5 5 5 /. . . . . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /# # # . . . /# . # . . . /# # # . . . /. . . # # # /. . . # . # /. . . # # # /"
25+
],
26+
[
27+
"bkShadeNe",
28+
"pzprv3/marutaring/5/5/5/0 0 0 1 1 /2 2 2 1 3 /2 2 2 2 3 /2 4 4 4 3 /2 4 4 3 3 /3 . . 1 . /. . . . . /. . . . . /. 3 . . . /. . . 4 . /# # # . . /# . # # # /# . . . # /# # # # # /. . . . . /"
29+
],
30+
[
31+
"shDeadEnd",
32+
"pzprv3/marutaring/5/5/5/0 0 0 1 1 /2 2 2 1 3 /2 2 2 2 3 /2 4 4 4 3 /2 4 4 3 3 /3 . . 1 . /. . . . . /. . . . . /. 3 . . . /. . . 4 . /# # # . . /# . # # # /# . . . # /# # . # # /. # . # . /"
33+
],
34+
[
35+
"cs2x2",
36+
"pzprv3/marutaring/5/5/5/0 0 0 1 1 /2 2 2 1 3 /2 2 2 2 3 /2 4 4 4 3 /2 4 4 3 3 /3 . . 1 . /. . . . . /. . . . . /. 3 . . . /. . . 4 . /# # # . . /# . # # # /# . . # # /# # # # . /. . . . . /"
37+
],
38+
[
39+
null,
40+
"pzprv3/marutaring/5/5/5/0 0 0 1 1 /2 2 2 1 3 /2 2 2 2 3 /2 4 4 4 3 /2 4 4 3 3 /3 . . 1 . /. . . . . /. . . . . /. 3 . . . /. . . 4 . /# # # . . /# . # # # /# . . . # /# . . # # /# # # # . /"
41+
]
42+
]
43+
});

0 commit comments

Comments
 (0)