diff --git a/src-ui/list.html b/src-ui/list.html index d80dc82ed..6376cb3da 100644 --- a/src-ui/list.html +++ b/src-ui/list.html @@ -105,6 +105,7 @@

パズルの種類のリスト
  • +
  • diff --git a/src/pzpr/variety.js b/src/pzpr/variety.js index ddac83b18..efc624f7c 100755 --- a/src/pzpr/variety.js +++ b/src/pzpr/variety.js @@ -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"], diff --git a/src/res/failcode.en.json b/src/res/failcode.en.json index 4dbeee42c..30a0119c8 100644 --- a/src/res/failcode.en.json +++ b/src/res/failcode.en.json @@ -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.", diff --git a/src/variety/shimaguni.js b/src/variety/shimaguni.js index 5310e409a..75646b60b 100644 --- a/src/variety/shimaguni.js +++ b/src/variety/shimaguni.js @@ -20,7 +20,8 @@ "marutaring", "tetroctb", "bramble", - "disco" + "disco", + "anymino" ], { //--------------------------------------------------------- @@ -46,7 +47,7 @@ play: ["shade", "unshade", "info-blk"] } }, - "MouseEvent@disco": { + "MouseEvent@disco,anymino": { inputModes: { edit: ["info-blk"], play: ["shade", "unshade", "info-blk"] @@ -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); } @@ -316,7 +315,7 @@ "AreaShadeGraph@chocona,tetroctb,bramble": { enabled: true }, - "AreaShadeGraph@nuritwin,marutaring,disco": { + "AreaShadeGraph@nuritwin,marutaring,disco,anymino": { enabled: true, coloring: true }, @@ -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" }, @@ -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(); @@ -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)", @@ -571,7 +565,7 @@ this.encodeNumber16(); } }, - "Encode@disco": { + "Encode@disco,anymino": { decodePzpr: function(type) { this.decodeBorder(); }, @@ -603,7 +597,7 @@ } } }, - "FileIO@disco": { + "FileIO@disco,anymino": { decodeData: function() { this.decodeBorderQues(); this.decodeCellAns(); @@ -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) { @@ -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", diff --git a/test/script/anymino.js b/test/script/anymino.js new file mode 100644 index 000000000..8cb63c726 --- /dev/null +++ b/test/script/anymino.js @@ -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: [] +});