Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src-ui/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
<li data-pid="tetroctb"></li>
<li data-pid="bramble"></li>
<li data-pid="disco"></li>
<li data-pid="anymino"></li>
</ul>
</div>
<div class="lists blocks">
Expand Down
1 change: 1 addition & 0 deletions src/pzpr/variety.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
angleloop: [0, 0, "鋭直鈍ループ", "Angle Loop", "kouchoku"],
anglers: [0, 0, "フィッシング", "Anglers"],
antmill: [0, 0, "Ant Mill", "Ant Mill", "scrin"],
anymino: [0, 0, "Anymino", "Anymino", "shimaguni"],
archipelago: [0, 0, "アーキペラゴ", "Archipelago", "chainedb"],
aqre: [0, 0, "Aqre", "Aqre", "aqre"],
aquapelago: [0, 0, "Aquapelago", "Aquapelago"],
Expand Down
1 change: 1 addition & 0 deletions src/res/failcode.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
"bkMSPassedGt2.moonsun": "A line passes the marks of the moon for two rooms in a row.",
"bkMUPassedGt2.moonsun": "A line passes the marks of the sun for two rooms in a row.",
"bkNoBorder.tetroctb": "A block does not cross a region border.",
"bkNoChain.anymino": "A block is not adjacent to another block of the same size.",
"bkNoChain.chainedb": "A block is not diagonally adjacent to another block.",
"bkNoChain.mrtile": "A block is not diagonally adjacent to another identical block.",
"bkNoChain.sendai": "A city is not adjacent to another city with the same shape and orientation.",
Expand Down
102 changes: 85 additions & 17 deletions src/variety/shimaguni.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"marutaring",
"tetroctb",
"bramble",
"disco"
"disco",
"anymino"
],
{
//---------------------------------------------------------
Expand All @@ -46,7 +47,7 @@
play: ["shade", "unshade", "info-blk"]
}
},
"MouseEvent@disco": {
"MouseEvent@disco,anymino": {
inputModes: {
edit: ["info-blk"],
play: ["shade", "unshade", "info-blk"]
Expand Down Expand Up @@ -192,9 +193,7 @@
},

Board: {
hasborder: 1
},
"Board@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring,tetroctb,disco": {
hasborder: 1,
addExtraInfo: function() {
this.stonegraph = this.addInfoList(this.klass.AreaStoneGraph);
}
Expand Down Expand Up @@ -316,7 +315,7 @@
"AreaShadeGraph@chocona,tetroctb,bramble": {
enabled: true
},
"AreaShadeGraph@nuritwin,marutaring,disco": {
"AreaShadeGraph@nuritwin,marutaring,disco,anymino": {
enabled: true,
coloring: true
},
Expand All @@ -328,7 +327,7 @@
component.hinge = null;
}
},
"AreaStoneGraph:AreaShadeGraph@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring,tetroctb,disco": {
"AreaStoneGraph:AreaShadeGraph": {
// Same as LITS AreaTetrominoGraph
enabled: true,
relation: { "cell.qans": "node", "border.ques": "separator" },
Expand Down Expand Up @@ -388,12 +387,7 @@
this.drawGrid();
}

if (
this.pid === "stostone" ||
this.pid === "nuritwin" ||
this.pid === "disco" ||
this.pid === "marutaring"
) {
if (this.irowakeblk) {
this.drawDotCells_stostone();
}
this.drawShadedCells();
Expand Down Expand Up @@ -434,7 +428,7 @@
);
}
},
"Graphic@stostone,nuritwin,marutaring,disco#1": {
"Graphic@stostone,nuritwin,marutaring,disco,anymino#1": {
irowakeblk: true,
bgcellcolor_func: "error1",
bcolor: "rgb(80, 204, 80)",
Expand Down Expand Up @@ -571,7 +565,7 @@
this.encodeNumber16();
}
},
"Encode@disco": {
"Encode@disco,anymino": {
decodePzpr: function(type) {
this.decodeBorder();
},
Expand Down Expand Up @@ -603,7 +597,7 @@
}
}
},
"FileIO@disco": {
"FileIO@disco,anymino": {
decodeData: function() {
this.decodeBorderQues();
this.decodeCellAns();
Expand Down Expand Up @@ -708,7 +702,19 @@
"doneShadingDecided"
]
},
"AnsCheck@shimaguni,stostone,heyablock,cocktail,martini,bramble": {
"AnsCheck@anymino#1": {
checklist: [
"checkShadeCellExist+",
"check2x2ShadeCell",
"checkSeqBlocksInRoom",
"checkAdjacentShapes",
"checkConnectShade",
"checkHasAdjacentSize",
"checkNoShadeCellInArea",
"doneShadingDecided"
]
},
"AnsCheck@shimaguni,stostone,heyablock,cocktail,martini,bramble,anymino": {
checkSideAreaShadeCell: function() {
this.checkSideAreaCell(
function(cell1, cell2) {
Expand Down Expand Up @@ -1259,6 +1265,68 @@
}
}
},
"AnsCheck@anymino#3": {
checkHasAdjacentSize: function() {
var bd = this.board;

var blocks = bd.stonegraph.components;
for (var r = 0; r < blocks.length; r++) {
blocks[r].valid = false;
}

for (var c = 0; c < bd.cell.length; c++) {
var cell = bd.cell[c];
var current = cell.stone;
if (!current) {
continue;
}
var right = cell.adjacent.right.stone;
var bottom = cell.adjacent.bottom.stone;

if (
right &&
right !== current &&
right.clist.length === current.clist.length
) {
right.valid = true;
current.valid = true;
}
if (
bottom &&
bottom !== current &&
bottom.clist.length === current.clist.length
) {
bottom.valid = true;
current.valid = true;
}
}

for (var r = 0; r < blocks.length; r++) {
if (!blocks[r].valid) {
this.failcode.add("bkNoChain");
if (this.checkOnly) {
break;
}
blocks[r].clist.seterr(1);
}
}
},
checkAdjacentShapes: function() {
var self = this;

this.checkSideAreaCell(
function(cell1, cell2) {
return (
cell1.isShade() &&
cell2.isShade() &&
!self.isDifferentShapeBlock(cell1.stone, cell2.stone)
);
},
true,
"bsSameShape"
);
}
},

FailCode: {
bkShadeDivide: "bkShadeDivide",
Expand Down
40 changes: 40 additions & 0 deletions test/script/anymino.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* anymino.js */

ui.debug.addDebugData("anymino", {
url: "6/6/199bo87c1h5f",
failcheck: [
[
"brNoShade",
"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 /. . . . . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /"
],
[
"bkNoShade",
"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 /. # # # # # /# # . . . # /. . . . . # /. . . . . # /. # . . # # /# # # # # . /"
],
[
"cs2x2",
"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 /. # # # # # /. # . # . # /# # # # # # /# # . . . # /. # . . . # /# # # # # . /"
],
[
"csDivide",
"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 /. . . . . . /. . . . . . /# # # # # . /# . . . . . /. # . . . . /# # # # # . /"
],
[
"bkShadeDivide",
"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 /. # # # # # /. # . . . # /. . . . . # /. . # # . # /. # . # . # /# # # # # . /"
],
[
"bsSameShape",
"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 /. # # # # # /. # . . . # /# # # # # # /. # . . . # /. # . . . # /# # # # # . /"
],
[
"bkNoChain",
"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 /. # # # # # /. # . . . # /# # # # # # /# . . . . # /. # . . . # /# # # # # # /"
],
[
null,
"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 /# # # # # # /. # . . . # /# # # # # # /# . . . . # /. # . . # # /# # # # # . /"
]
],
inputs: []
});
Loading