Skip to content

Commit a61e0ba

Browse files
authored
Add Tetrochain-K
1 parent b28a41d commit a61e0ba

7 files changed

Lines changed: 169 additions & 12 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?tetrochaink" target="_parent">Tetrochain-K テトロチェーンK</a></li>
3637
<li><a href="/p?bunnyhop" target="_parent">Bunnyhop</a></li>
3738
<li><a href="/p?sashikabe" target="_parent">Sashikabe</a></li>
3839
<li><a href="/p?blindrush" target="_parent">Blind Rush 猪突猛進</a></li>
3940
<li><a href="/p?cityspace" target="_parent">City Space</a></li>
4041
<li><a href="/p?numcity" target="_parent">Number City ナンバーシティ一</a></li>
4142
<li><a href="/p?distopia" target="_parent">Distopia</a></li>
42-
<li><a href="/p?uturns" target="_parent">U-Turns</a></li>
4343
</ul>
4444
</main>
4545
</body>

src-ui/img/tetrochaink.png

146 Bytes
Loading

src-ui/js/ui/Misc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ function toBGimage(pid) {
225225
"tents",
226226
"teri",
227227
"tetrochain",
228+
"tetrochaink",
228229
"tetrominous",
229230
"tilecity",
230231
"timebomb",

src-ui/list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
6969
<li data-pid="isowatari"></li>
7070
<li data-pid="cityspace"></li>
7171
<li data-pid="sashikabe"></li>
72+
<li data-pid="tetrochaink"></li>
7273
</ul>
7374
</div>
7475
<div class="lists blocks">

src/pzpr/variety.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@
443443
tents: [0, 0, "Tents", "Tents", "tents"],
444444
teri: [0, 0, "テリトリー", "Territory", "kurodoko"],
445445
tetrochain: [0, 0, "テトロチェーン", "Tetrochain"],
446+
tetrochaink: [0, 0, "テトロチェーンK", "Tetrochain-K", "kurarin"],
446447
tetrominous: [0, 0, "Tetrominous", "Tetrominous", "fillomino"],
447448
tilecity: [0, 0, "タイルシティー", "Tile City"],
448449
tilepaint: [1, 0, "タイルペイント", "Tilepaint"],

src/variety/kurarin.js

Lines changed: 125 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
} else {
55
pzpr.classmgr.makeCustom(pidlist, classbase);
66
}
7-
})(["kurarin"], {
7+
})(["kurarin", "tetrochaink"], {
88
//---------------------------------------------------------
99
// マウス入力系
1010
MouseEvent: {
@@ -95,6 +95,25 @@
9595
}
9696
}
9797
},
98+
"MouseEvent@tetrochaink": {
99+
inputModes: {
100+
edit: ["info-blk"],
101+
play: ["shade", "unshade", "info-blk"]
102+
},
103+
mouseinputAutoPlay: function() {
104+
this.inputShade();
105+
},
106+
dispInfoBlk: function() {
107+
var cell = this.getcell();
108+
this.mousereset();
109+
if (cell.isnull || !cell.isShade()) {
110+
return;
111+
}
112+
cell.blk8.clist.setinfo(1);
113+
this.board.hasinfo = true;
114+
this.puzzle.redraw();
115+
}
116+
},
98117

99118
//---------------------------------------------------------
100119
// キーボード入力系
@@ -177,33 +196,39 @@
177196
}
178197
},
179198

180-
LineGraph: {
199+
"LineGraph@kurarin": {
200+
enabled: true
201+
},
202+
"AreaShadeGraph@tetrochaink": {
203+
enabled: true
204+
},
205+
"AreaShade8Graph@tetrochaink": {
181206
enabled: true
182207
},
183208

184209
//---------------------------------------------------------
185210
// 画像表示系
186211
Graphic: {
187-
gridcolor_type: "LIGHT",
188-
irowake: true,
189-
190212
shadecolor: "#444444",
191213
enablebcolor: true,
192214

193215
paint: function() {
194216
this.drawBGCells();
195217

196218
this.drawShadedCells();
197-
this.drawDotCells();
219+
if (this.pid === "kurarin") {
220+
this.drawDotCells();
221+
}
198222
this.drawGrid();
199223

200224
this.drawDots();
201225

202226
this.drawChassis();
203227

204-
this.drawLines();
205-
206-
this.drawPekes();
228+
if (this.pid === "kurarin") {
229+
this.drawLines();
230+
this.drawPekes();
231+
}
207232

208233
this.drawCursor(false, this.puzzle.editmode);
209234
},
@@ -231,6 +256,13 @@
231256
return null;
232257
}
233258
},
259+
"Graphic@kurarin": {
260+
gridcolor_type: "LIGHT",
261+
irowake: true
262+
},
263+
"Graphic@tetrochaink": {
264+
bgcellcolor_func: "qsub1"
265+
},
234266

235267
//---------------------------------------------------------
236268
// URLエンコード/デコード処理
@@ -269,12 +301,16 @@
269301
decodeData: function() {
270302
this.decodeDotFile();
271303
this.decodeCellAns();
272-
this.decodeBorderLine();
304+
if (this.pid === "kurarin") {
305+
this.decodeBorderLine();
306+
}
273307
},
274308
encodeData: function() {
275309
this.encodeDotFile();
276310
this.encodeCellAns();
277-
this.encodeBorderLine();
311+
if (this.pid === "kurarin") {
312+
this.encodeBorderLine();
313+
}
278314
}
279315
},
280316

@@ -342,6 +378,84 @@
342378
}, "ceEmpty");
343379
}
344380
},
381+
"AnsCheck@tetrochaink": {
382+
checklist: [
383+
"checkOverShadeCell",
384+
"checkAdjacentShapes",
385+
386+
"checkShadeWhite",
387+
"checkUnderShadeCell",
388+
"checkShadeBlack",
389+
"checkShadeGray",
390+
391+
"checkConnect8Shade",
392+
"doneShadingDecided"
393+
],
394+
395+
checkOverShadeCell: function() {
396+
this.checkAllArea(
397+
this.board.sblkmgr,
398+
function(w, h, a, n) {
399+
return a <= 4;
400+
},
401+
"csGt4"
402+
);
403+
},
404+
checkUnderShadeCell: function() {
405+
this.checkAllArea(
406+
this.board.sblkmgr,
407+
function(w, h, a, n) {
408+
return a >= 4;
409+
},
410+
"csLt4"
411+
);
412+
},
413+
checkConnect8Shade: function() {
414+
this.checkOneArea(this.board.sblk8mgr, "csDivide");
415+
},
416+
417+
checkAdjacentShapes: function() {
418+
var bd = this.board;
419+
for (var c = 0; c < bd.cell.length; c++) {
420+
var cell = bd.cell[c];
421+
if (cell.bx === bd.maxbx - 1 || cell.by === bd.maxby - 1) {
422+
continue;
423+
}
424+
425+
var i,
426+
adc = cell.adjacent;
427+
var cells = [
428+
[cell, adc.right.adjacent.bottom],
429+
[adc.right, adc.bottom]
430+
];
431+
for (i = 0; i < 2; i++) {
432+
if (cells[i][0].isShade() && cells[i][1].isShade()) {
433+
break;
434+
}
435+
}
436+
if (i === 2) {
437+
continue;
438+
}
439+
440+
var block1 = cells[i][0].sblk,
441+
block2 = cells[i][1].sblk;
442+
if (
443+
block1 === block2 ||
444+
block1.clist.length !== 4 ||
445+
this.isDifferentShapeBlock(block1, block2)
446+
) {
447+
continue;
448+
}
449+
450+
this.failcode.add("bsSameShape");
451+
if (this.checkOnly) {
452+
break;
453+
}
454+
block1.clist.seterr(1);
455+
block2.clist.seterr(1);
456+
}
457+
}
458+
},
345459
FailCode: {
346460
ceEmpty: "ceEmpty.yajilin"
347461
}

test/script/tetrochaink.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* tetrochaink.js */
2+
3+
ui.debug.addDebugData("tetrochaink", {
4+
url: "6/6/l44k3ict4m4k2j88n",
5+
failcheck: [
6+
[
7+
"csLt4",
8+
"pzprv3/tetrochaink/6/6/.........../.1.1......./.....3...../.3........./.........../.........1./.........../...1......./.....2...../...2.2...../.........../# # # . . . /. # . . . . /. . # . # # /. . # . # # /. # # . . . /. . . # # # /"
9+
],
10+
[
11+
"csGt4",
12+
"pzprv3/tetrochaink/6/6/.........../.1.1......./.....3...../.3........./.........../.........1./.........../...1......./.....2...../...2.2...../.........../# # # # . . /. # . . . . /. . # . . . /. . # . . . /. # # . . . /. . . . . . /"
13+
],
14+
[
15+
"bsSameShape",
16+
"pzprv3/tetrochaink/6/6/.........../.1.1......./.....3...../.3........./.........../.........1./.........../...1......./.....2...../...2.2...../.........../# # # . . . /. # . . . # /. . # . # # /. . # . . # /. # # . # . /. . . # # # /"
17+
],
18+
[
19+
"csDivide",
20+
"pzprv3/tetrochaink/6/6/.........../.1.1......./.....3...../.3........./.........../.........1./.........../...1......./.....2...../...2.2...../.........../# # # . . . /. # . . . . /. . . # # # /. # # . # . /. # # . . # /. . . # # # /"
21+
],
22+
[
23+
"csDotBlack",
24+
"pzprv3/tetrochaink/6/6/.........../.1.1......./.....3...../.3........./.........../.........1./.........../...1......./.....2...../...2.2...../.........../. # # # . . /. # . . # . /. . . # # # /. # # . . . /. . # . . . /. . # . . . /"
25+
],
26+
[
27+
"csDotGray",
28+
"pzprv3/tetrochaink/6/6/.........../.1.1......./.....3...../.3........./.........../.........1./.........../...1......./.....2...../...2.2...../.........../# # # . . . /. # . . . . /. . # . # # /. # # . . # /. # . # . # /. . # # # . /"
29+
],
30+
[
31+
"csDotWhite",
32+
"pzprv3/tetrochaink/6/6/.........../.1.1......./.....3...../.3........./.........../.........1./.........../...1......./.....2...../...2.2...../.........../. # # . . . /# # . . . . /. . . . . . /. # # . . . /. # # . # . /. . . # # # /"
33+
],
34+
[
35+
null,
36+
"pzprv3/tetrochaink/6/6/.........../.1.1......./.....3...../.3........./.........../.........1./.........../...1......./.....2...../...2.2...../.........../# # # + + + /+ # + + # + /+ + # + # # /+ + # + + # /+ # # + # + /+ + + # # # /"
37+
]
38+
],
39+
inputs: []
40+
});

0 commit comments

Comments
 (0)