Skip to content

Commit adc4b7c

Browse files
authored
Add Anymino
1 parent 078219c commit adc4b7c

5 files changed

Lines changed: 128 additions & 17 deletions

File tree

src-ui/list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
105105
<li data-pid="tetroctb"></li>
106106
<li data-pid="bramble"></li>
107107
<li data-pid="disco"></li>
108+
<li data-pid="anymino"></li>
108109
</ul>
109110
</div>
110111
<div class="lists blocks">

src/pzpr/variety.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
angleloop: [0, 0, "鋭直鈍ループ", "Angle Loop", "kouchoku"],
9191
anglers: [0, 0, "フィッシング", "Anglers"],
9292
antmill: [0, 0, "Ant Mill", "Ant Mill", "scrin"],
93+
anymino: [0, 0, "Anymino", "Anymino", "shimaguni"],
9394
archipelago: [0, 0, "アーキペラゴ", "Archipelago", "chainedb"],
9495
aqre: [0, 0, "Aqre", "Aqre", "aqre"],
9596
aquapelago: [0, 0, "Aquapelago", "Aquapelago"],

src/res/failcode.en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
"bkMSPassedGt2.moonsun": "A line passes the marks of the moon for two rooms in a row.",
156156
"bkMUPassedGt2.moonsun": "A line passes the marks of the sun for two rooms in a row.",
157157
"bkNoBorder.tetroctb": "A block does not cross a region border.",
158+
"bkNoChain.anymino": "A block is not adjacent to another block of the same size.",
158159
"bkNoChain.chainedb": "A block is not diagonally adjacent to another block.",
159160
"bkNoChain.mrtile": "A block is not diagonally adjacent to another identical block.",
160161
"bkNoChain.sendai": "A city is not adjacent to another city with the same shape and orientation.",

src/variety/shimaguni.js

Lines changed: 85 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"marutaring",
2121
"tetroctb",
2222
"bramble",
23-
"disco"
23+
"disco",
24+
"anymino"
2425
],
2526
{
2627
//---------------------------------------------------------
@@ -46,7 +47,7 @@
4647
play: ["shade", "unshade", "info-blk"]
4748
}
4849
},
49-
"MouseEvent@disco": {
50+
"MouseEvent@disco,anymino": {
5051
inputModes: {
5152
edit: ["info-blk"],
5253
play: ["shade", "unshade", "info-blk"]
@@ -192,9 +193,7 @@
192193
},
193194

194195
Board: {
195-
hasborder: 1
196-
},
197-
"Board@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring,tetroctb,disco": {
196+
hasborder: 1,
198197
addExtraInfo: function() {
199198
this.stonegraph = this.addInfoList(this.klass.AreaStoneGraph);
200199
}
@@ -316,7 +315,7 @@
316315
"AreaShadeGraph@chocona,tetroctb,bramble": {
317316
enabled: true
318317
},
319-
"AreaShadeGraph@nuritwin,marutaring,disco": {
318+
"AreaShadeGraph@nuritwin,marutaring,disco,anymino": {
320319
enabled: true,
321320
coloring: true
322321
},
@@ -328,7 +327,7 @@
328327
component.hinge = null;
329328
}
330329
},
331-
"AreaStoneGraph:AreaShadeGraph@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring,tetroctb,disco": {
330+
"AreaStoneGraph:AreaShadeGraph": {
332331
// Same as LITS AreaTetrominoGraph
333332
enabled: true,
334333
relation: { "cell.qans": "node", "border.ques": "separator" },
@@ -388,12 +387,7 @@
388387
this.drawGrid();
389388
}
390389

391-
if (
392-
this.pid === "stostone" ||
393-
this.pid === "nuritwin" ||
394-
this.pid === "disco" ||
395-
this.pid === "marutaring"
396-
) {
390+
if (this.irowakeblk) {
397391
this.drawDotCells_stostone();
398392
}
399393
this.drawShadedCells();
@@ -434,7 +428,7 @@
434428
);
435429
}
436430
},
437-
"Graphic@stostone,nuritwin,marutaring,disco#1": {
431+
"Graphic@stostone,nuritwin,marutaring,disco,anymino#1": {
438432
irowakeblk: true,
439433
bgcellcolor_func: "error1",
440434
bcolor: "rgb(80, 204, 80)",
@@ -571,7 +565,7 @@
571565
this.encodeNumber16();
572566
}
573567
},
574-
"Encode@disco": {
568+
"Encode@disco,anymino": {
575569
decodePzpr: function(type) {
576570
this.decodeBorder();
577571
},
@@ -603,7 +597,7 @@
603597
}
604598
}
605599
},
606-
"FileIO@disco": {
600+
"FileIO@disco,anymino": {
607601
decodeData: function() {
608602
this.decodeBorderQues();
609603
this.decodeCellAns();
@@ -708,7 +702,19 @@
708702
"doneShadingDecided"
709703
]
710704
},
711-
"AnsCheck@shimaguni,stostone,heyablock,cocktail,martini,bramble": {
705+
"AnsCheck@anymino#1": {
706+
checklist: [
707+
"checkShadeCellExist+",
708+
"check2x2ShadeCell",
709+
"checkSeqBlocksInRoom",
710+
"checkAdjacentShapes",
711+
"checkConnectShade",
712+
"checkHasAdjacentSize",
713+
"checkNoShadeCellInArea",
714+
"doneShadingDecided"
715+
]
716+
},
717+
"AnsCheck@shimaguni,stostone,heyablock,cocktail,martini,bramble,anymino": {
712718
checkSideAreaShadeCell: function() {
713719
this.checkSideAreaCell(
714720
function(cell1, cell2) {
@@ -1259,6 +1265,68 @@
12591265
}
12601266
}
12611267
},
1268+
"AnsCheck@anymino#3": {
1269+
checkHasAdjacentSize: function() {
1270+
var bd = this.board;
1271+
1272+
var blocks = bd.stonegraph.components;
1273+
for (var r = 0; r < blocks.length; r++) {
1274+
blocks[r].valid = false;
1275+
}
1276+
1277+
for (var c = 0; c < bd.cell.length; c++) {
1278+
var cell = bd.cell[c];
1279+
var current = cell.stone;
1280+
if (!current) {
1281+
continue;
1282+
}
1283+
var right = cell.adjacent.right.stone;
1284+
var bottom = cell.adjacent.bottom.stone;
1285+
1286+
if (
1287+
right &&
1288+
right !== current &&
1289+
right.clist.length === current.clist.length
1290+
) {
1291+
right.valid = true;
1292+
current.valid = true;
1293+
}
1294+
if (
1295+
bottom &&
1296+
bottom !== current &&
1297+
bottom.clist.length === current.clist.length
1298+
) {
1299+
bottom.valid = true;
1300+
current.valid = true;
1301+
}
1302+
}
1303+
1304+
for (var r = 0; r < blocks.length; r++) {
1305+
if (!blocks[r].valid) {
1306+
this.failcode.add("bkNoChain");
1307+
if (this.checkOnly) {
1308+
break;
1309+
}
1310+
blocks[r].clist.seterr(1);
1311+
}
1312+
}
1313+
},
1314+
checkAdjacentShapes: function() {
1315+
var self = this;
1316+
1317+
this.checkSideAreaCell(
1318+
function(cell1, cell2) {
1319+
return (
1320+
cell1.isShade() &&
1321+
cell2.isShade() &&
1322+
!self.isDifferentShapeBlock(cell1.stone, cell2.stone)
1323+
);
1324+
},
1325+
true,
1326+
"bsSameShape"
1327+
);
1328+
}
1329+
},
12621330

12631331
FailCode: {
12641332
bkShadeDivide: "bkShadeDivide",

test/script/anymino.js

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

0 commit comments

Comments
 (0)