Skip to content

Commit a361056

Browse files
authored
Add Golem Grad
1 parent 03c7425 commit a361056

6 files changed

Lines changed: 163 additions & 9 deletions

File tree

src-ui/js/ui/KeyPopup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ ui.keypopup = {
256256
tetroctb: [10, 0],
257257
hasunomura: [10, 0],
258258
bramble: [10, 0],
259+
golemgrad: [10, 0],
259260
topo: [10, 10]
260261
},
261262

src-ui/list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
236236
<li data-pid="mintonette"></li>
237237
<li data-pid="wataridori"></li>
238238
<li data-pid="uturns"></li>
239+
<li data-pid="golemgrad"></li>
239240
</ul>
240241
</div>
241242
<div class="lists lines">

src/pzpr/variety.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@
184184
geradeweg: [0, 0, "グラーデヴェグ", "Geradeweg"],
185185
goishi: [0, 1, "碁石ひろい", "Goishi"],
186186
gokigen: [1, 0, "ごきげんななめ", "Slant", "gokigen"],
187+
golemgrad: [0, 0, "Golem Grad", "Golem Grad", "nuriloop"],
187188
guidearrow: [0, 0, "ガイドアロー", "Guide Arrow"],
188189
haisu: [0, 0, "Haisu", "Haisu"],
189190
hakoiri: [1, 0, "はこいり○△□", "Hakoiri-masashi"],

src/res/failcode.en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@
447447
"csCornerSize.nuribou": "Masses of shaded cells with the same length share a corner.",
448448
"csdDivide.scrin": "There is a rectangle that is not connected to the other rectangles.",
449449
"csDistance.nothree": "Three consecutive cells in the same row have the same distance.",
450+
"csDivide.golemgrad": "The cells containing lines are divided.",
450451
"csDivide.shugaku": "The aisle is divided.",
451452
"csDivide": "The shaded cells are divided.",
452453
"csDivide8.mochikoro": "The unshaded cells are divided.",
@@ -608,6 +609,7 @@
608609
"lcTripleNum.kusabi": "Three or more objects are connected.",
609610
"lcTripleNum.wblink": "Three or more objects are connected.",
610611
"lcTripleNum": "Three or more numbers are connected.",
612+
"ln2x2": "There is a 2x2 square of cells containing lines.",
611613
"lnAdjacent.balloon": "A string loops back on itself.",
612614
"lnAdjacent.ladders": "Two ladders touch.",
613615
"lnAdjacent.pmemory": "The path loops back on itself.",

src/variety/nuriloop.js

Lines changed: 97 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
} else {
55
pzpr.classmgr.makeCustom(pidlist, classbase);
66
}
7-
})(["nuriloop"], {
7+
})(["nuriloop", "golemgrad"], {
88
MouseEvent: {
99
use: true,
1010
inputModes: {
@@ -14,6 +14,19 @@
1414
autoedit_func: "qnum",
1515
autoplay_func: "lineMB"
1616
},
17+
"MouseEvent@golemgrad": {
18+
inputModes: {
19+
edit: ["number", "circle-unshade", "clear", "info-blk"],
20+
play: ["line", "peke", "bgcolor", "bgcolor1", "bgcolor2", "info-blk"]
21+
},
22+
mouseinput: function() {
23+
if (this.inputMode === "circle-unshade") {
24+
this.inputFixedNumber(0);
25+
} else {
26+
this.common.mouseinput.call(this);
27+
}
28+
}
29+
},
1730

1831
KeyEvent: {
1932
enablemake: true
@@ -25,23 +38,37 @@
2538
Border: {
2639
enableLineNG: true
2740
},
41+
"Cell@golemgrad": {
42+
minnum: 0
43+
},
2844
Cell: {
2945
maxnum: function() {
3046
return this.board.cols * this.board.rows;
3147
},
3248
noLP: function() {
33-
return this.isNum();
49+
return this.isNum() && this.qnum !== 0;
50+
},
51+
isShade: function() {
52+
return this.lcnt > 0 || this.qnum === 0;
3453
},
3554
isUnshade: function() {
36-
return this.lcnt === 0;
55+
return this.lcnt === 0 && this.qnum !== 0;
3756
}
3857
},
3958
LineGraph: {
4059
enabled: true
4160
},
61+
"AreaShadeGraph@golemgrad": {
62+
enabled: true,
63+
relation: { "cell.qnum": "node", "border.line": "block" },
64+
modifyOtherInfo: function(border, relation) {
65+
this.setEdgeByNodeObj(border.sidecell[0]);
66+
this.setEdgeByNodeObj(border.sidecell[1]);
67+
}
68+
},
4269
AreaUnshadeGraph: {
4370
enabled: true,
44-
relation: { "border.line": "block" },
71+
relation: { "cell.qnum": "node", "border.line": "block" },
4572
modifyOtherInfo: function(border, relation) {
4673
this.setEdgeByNodeObj(border.sidecell[0]);
4774
this.setEdgeByNodeObj(border.sidecell[1]);
@@ -64,11 +91,28 @@
6491
this.drawLines();
6592
this.drawPekes();
6693

94+
if (this.pid === "golemgrad") {
95+
this.drawCircles();
96+
}
97+
6798
this.drawChassis();
6899

69100
this.drawTarget();
70101
}
71102
},
103+
"Graphic@golemgrad": {
104+
lwratio: 8,
105+
circleratio: [0.25, 0.2],
106+
getCircleFillColor: function(cell) {
107+
return cell.qnum === 0 ? "white" : null;
108+
},
109+
getCircleStrokeColor: function(cell) {
110+
return cell.qnum === 0 ? this.quescolor : null;
111+
},
112+
getNumberTextCore: function(num) {
113+
return num > 0 ? "" + num : num === -2 ? "?" : "";
114+
}
115+
},
72116

73117
Encode: {
74118
decodePzpr: function(type) {
@@ -97,18 +141,23 @@
97141
"checkBranchLine",
98142
"checkCrossLine",
99143
"checkLineOverlap",
144+
"checkLoop@golemgrad",
145+
"check2x2PathCell@golemgrad",
146+
"checkLineOverObject@golemgrad",
100147

101-
"checkNoNumberInUnshade",
148+
"checkNoNumberInUnshade@nuriloop",
102149
"checkDoubleNumberInUnshade",
103150
"checkNumberAndUnshadeSize",
151+
"checkConnectShade@golemgrad",
152+
"checkNoLineObject@golemgrad",
104153

105154
"checkDeadendLine+",
106-
"checkOneLoop"
155+
"checkOneLoop@nuriloop"
107156
],
108157

109158
checkLineOverlap: function() {
110159
this.checkAllCell(function(cell) {
111-
return cell.lcnt > 0 && cell.qnum !== -1;
160+
return cell.lcnt > 0 && cell.isNum() && cell.qnum !== 0;
112161
}, "lnOverlap");
113162
},
114163

@@ -126,7 +175,7 @@
126175
},
127176
checkNumberAndUnshadeSize: function() {
128177
this.checkAllCell(function(cell) {
129-
if (!cell.isValidNum()) {
178+
if (cell.qnum <= 0) {
130179
return false;
131180
}
132181
if (!cell.ublk) {
@@ -154,7 +203,46 @@
154203
);
155204
}
156205
},
206+
"AnsCheck@golemgrad": {
207+
check2x2PathCell: function() {
208+
this.check2x2Block(function(cell) {
209+
return cell.qnum === 0 || cell.lcnt > 0;
210+
}, "ln2x2");
211+
},
212+
checkDeadendLine: function() {
213+
this.checkAllCell(function(cell) {
214+
return cell.lcnt === 1 && cell.qnum !== 0;
215+
}, "lnDeadEnd");
216+
},
217+
checkLoop: function() {
218+
var bd = this.board;
219+
var paths = bd.linegraph.components;
220+
for (var r = 0; r < paths.length; r++) {
221+
if (paths[r].circuits === 0) {
222+
continue;
223+
}
224+
this.failcode.add("laLoop");
225+
if (this.checkOnly) {
226+
break;
227+
}
228+
this.board.border.setnoerr();
229+
paths[r].setedgeerr(1);
230+
}
231+
},
232+
checkNoLineObject: function() {
233+
this.checkAllCell(function(cell) {
234+
return cell.qnum === 0 && cell.lcnt === 0;
235+
}, "nmNoLine");
236+
},
237+
checkLineOverObject: function() {
238+
this.checkAllCell(function(cell) {
239+
return cell.qnum === 0 && cell.lcnt >= 2;
240+
}, "lcOnNum");
241+
}
242+
},
157243
FailCode: {
158-
lnOverlap: "lnOverlap.tontti"
244+
lnOverlap: "lnOverlap.tontti",
245+
lcOnNum: "lcOnNum.kusabi",
246+
nmNoLine: "nmNoLine.kusabi"
159247
}
160248
});

test/script/golemgrad.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/* golemgrad.js */
2+
3+
ui.debug.addDebugData("golemgrad", {
4+
url: "6/6/30o0g0g4g0m1g0l.0",
5+
failcheck: [
6+
[
7+
"brNoLine",
8+
"pzprv3/golemgrad/6/6/3 0 . . . . /. . . . . 0 /. 0 . 4 . 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 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 /0 0 0 0 0 0 /",
9+
{ skiprules: true }
10+
],
11+
[
12+
"nmNoLine",
13+
"pzprv3/golemgrad/6/6/. 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 1 1 1 1 /0 0 0 0 0 /0 0 0 0 1 /0 0 0 0 0 /0 0 0 0 1 /0 1 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 1 0 /"
14+
],
15+
[
16+
"lnBranch",
17+
"pzprv3/golemgrad/6/6/3 0 . . . . /. . . . . 0 /. 0 . 4 . 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 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 1 /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 1 0 1 /0 0 0 0 0 1 /"
18+
],
19+
[
20+
"lnCross",
21+
"pzprv3/golemgrad/6/6/3 0 . . . . /. . . . . 0 /. 0 . 4 . 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 0 0 0 0 0 /0 0 0 0 0 0 /0 0 0 0 0 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/0 0 1 0 0 0 /0 0 0 0 0 0 /"
34+
],
35+
[
36+
"lcOnNum",
37+
"pzprv3/golemgrad/6/6/3 0 . . . . /. . . . . 0 /. 0 . 4 . 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 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 1 0 0 /0 0 0 0 0 /0 1 0 0 0 0 /0 1 0 0 0 0 /0 1 0 0 0 0 /0 0 1 0 0 0 /0 0 0 0 0 0 /"
38+
],
39+
[
40+
"bkNumGe2",
41+
"pzprv3/golemgrad/6/6/3 0 . . . . /. . . . . 0 /. 0 . 4 . 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 0 0 0 0 0 /0 0 0 0 0 0 /0 0 0 0 0 /0 1 1 1 1 /0 0 0 0 0 /1 0 0 0 0 /0 0 1 0 0 /1 1 0 0 0 /0 1 0 0 0 0 /0 0 0 0 0 0 /0 1 0 0 0 1 /1 0 0 0 0 1 /1 0 1 0 0 1 /"
42+
],
43+
[
44+
"bkSizeNe",
45+
"pzprv3/golemgrad/6/6/3 0 . . . . /. . . . . 0 /. 0 . 4 . 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 0 0 0 0 0 /0 0 0 0 0 0 /0 0 0 1 1 /0 1 1 0 0 /0 0 0 0 1 /1 1 1 1 0 /0 0 0 0 0 /1 1 1 0 0 /0 1 0 1 0 1 /0 0 0 0 0 0 /0 0 0 0 1 0 /1 0 0 0 0 0 /1 0 0 1 0 0 /"
46+
],
47+
[
48+
"csDivide",
49+
"pzprv3/golemgrad/6/6/3 0 . . . . /. . . . . 0 /. 0 . 4 . 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 0 0 0 0 0 /0 0 0 0 0 0 /0 0 0 0 0 /0 1 1 1 1 /0 0 0 0 0 /0 1 0 0 1 /0 0 0 1 0 /1 1 0 0 0 /0 1 0 0 0 0 /0 0 0 0 0 0 /0 1 0 0 0 1 /1 0 1 0 1 0 /1 0 1 0 0 0 /"
50+
],
51+
[
52+
"lnDeadEnd",
53+
"pzprv3/golemgrad/6/6/3 0 . . . . /. . . . . 0 /. 0 . 4 . 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 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 1 /1 0 0 0 0 /0 0 1 0 1 /1 1 0 0 0 /0 1 0 0 0 1 /0 0 0 0 0 0 /0 1 0 0 1 0 /1 0 0 0 1 0 /1 0 1 0 0 1 /"
54+
],
55+
[
56+
null,
57+
"pzprv3/golemgrad/6/6/3 0 . . . . /. . . . . 0 /. 0 . 4 . 0 /. . . . . . /. 1 . 0 . . /. . . . - 0 /0 1 0 1 1 1 /0 1 1 1 0 1 /0 1 0 0 1 1 /1 1 0 0 1 0 /1 0 1 1 1 1 /1 1 1 0 0 1 /0 0 0 1 1 /0 1 1 0 0 /0 0 0 0 1 /1 0 0 0 0 /0 0 1 0 1 /1 1 0 0 0 /0 1 0 1 0 1 /0 0 0 0 0 0 /0 1 0 0 1 0 /1 0 0 0 1 0 /1 0 1 0 0 1 /"
58+
]
59+
],
60+
inputs: []
61+
});

0 commit comments

Comments
 (0)