diff --git a/src-ui/img/bramble.png b/src-ui/img/bramble.png new file mode 100644 index 000000000..c97a9d4ad Binary files /dev/null and b/src-ui/img/bramble.png differ diff --git a/src-ui/js/ui/KeyPopup.js b/src-ui/js/ui/KeyPopup.js index 7f09d33a2..dc7fca9ea 100644 --- a/src-ui/js/ui/KeyPopup.js +++ b/src-ui/js/ui/KeyPopup.js @@ -251,6 +251,7 @@ ui.keypopup = { marutaring: [10, 0], tetroctb: [10, 0], hasunomura: [10, 0], + bramble: [10, 0], topo: [10, 10] }, diff --git a/src-ui/js/ui/Misc.js b/src-ui/js/ui/Misc.js index 19e3277aa..e09e4b3b8 100755 --- a/src-ui/js/ui/Misc.js +++ b/src-ui/js/ui/Misc.js @@ -119,6 +119,7 @@ function toBGimage(pid) { "bdwalk", "bhaibahan", "bosnianroad", + "bramble", "brownies", "bunnyhop", "castle", diff --git a/src-ui/list.html b/src-ui/list.html index 639666d0e..7e6743fd5 100644 --- a/src-ui/list.html +++ b/src-ui/list.html @@ -102,6 +102,7 @@

パズルの種類のリスト
  • +
  • diff --git a/src/pzpr/variety.js b/src/pzpr/variety.js index 018951f69..c78afaca9 100755 --- a/src/pzpr/variety.js +++ b/src/pzpr/variety.js @@ -112,6 +112,7 @@ bosanowa: [1, 0, "ボサノワ", "Bosanowa", "", { alias: "bossanova" }], bosnianroad: [0, 0, "Bosnian Road", "Bosnian Road"], box: [0, 0, "ボックス", "Box"], + bramble: [0, 0, "Bramble", "Bramble", "shimaguni"], brownies: [0, 0, "ブラウニー", "Brownies", "yosenabe"], bunnyhop: [0, 0, "Bunnyhop", "Bunnyhop", "", { alias: "bnuuyhop" }], cave: [1, 0, "バッグ", "Cave", "kurodoko", { alias: "bag" }], diff --git a/src/res/failcode.en.json b/src/res/failcode.en.json index b924b1c7e..8db5e1e7c 100644 --- a/src/res/failcode.en.json +++ b/src/res/failcode.en.json @@ -458,7 +458,7 @@ "csGt4": "The size of a mass of shaded cells is over four.", "csGtLimit.kissing": "Two blocks are adjacent in an invalid location.", "csGtN.isowatari": "The size of a mass of shaded cells is greater than the indicated number.", - "csLoop.parquet": "There is a loop of shaded cells.", + "csLoop": "There is a loop of shaded cells.", "csLt1.edamame": "A rectangle has no circle in the middle.", "csLt1.nothree": "A dot doesn't overlap a shaded cell.", "csLt1.sumiwake": "A circle doesn't overlap a shaded cell.", @@ -937,6 +937,7 @@ "shDiag.batten": "A checkerboard pattern isn't marked with a clue.", "shDiag.battleship": "Two ships are diagonally adjacent.", "shDiag.bosnianroad": "The loop touches itself diagonally.", + "shDiag.bramble": "Two single-cell blocks are diagonally adjacent.", "shDiag.pentatouch": "A place where two pieces touch isn't marked with a point.", "shDiag.snake": "The snake touches itself diagonally.", "shDiag": "Two pieces are diagonally adjacent.", diff --git a/src/res/failcode.ja.json b/src/res/failcode.ja.json index 9d690a7ad..ae9eb1157 100644 --- a/src/res/failcode.ja.json +++ b/src/res/failcode.ja.json @@ -318,7 +318,7 @@ "csDivide": "黒マスが分断されています。", "csDivide8.mochikoro": "孤立した白マスのブロックがあります。", "csGt2": "2マスより大きい黒マスのカタマリがあります。", - "csLoop.parquet": "黒マスがループになっています。", + "csLoop": "黒マスがループになっています。", "csLt2": "1マスだけの黒マスのカタマリがあります。", "csNoLevel.aquarium": "ひとつながりの水のマスの水位が等しくなっていません。", "csNoSupport.aquarium": "水の入っているマスの隣や下のマスが空白になっています。", diff --git a/src/variety/shimaguni.js b/src/variety/shimaguni.js index 0d5ba71e4..f75464c59 100644 --- a/src/variety/shimaguni.js +++ b/src/variety/shimaguni.js @@ -18,7 +18,8 @@ "martini", "nuritwin", "marutaring", - "tetroctb" + "tetroctb", + "bramble" ], { //--------------------------------------------------------- @@ -38,13 +39,13 @@ play: ["shade", "unshade", "number"] } }, - "MouseEvent@cocktail,nuritwin,marutaring,tetroctb": { + "MouseEvent@cocktail,nuritwin,marutaring,tetroctb,bramble": { inputModes: { edit: ["border", "number", "clear", "info-blk"], play: ["shade", "unshade", "info-blk"] } }, - "MouseEvent@cocktail,martini,tetroctb#2": { + "MouseEvent@cocktail,martini,tetroctb,bramble#2": { dispInfoBlk: function() { var cell = this.getcell(); this.mousereset(); @@ -124,7 +125,7 @@ enableSubNumberArray: true, disableAnum: true }, - "Cell@chocona,hinge,heyablock,cocktail,tetroctb": { + "Cell@chocona,hinge,heyablock,cocktail,tetroctb,bramble": { minnum: 0 }, "Cell@martini": { @@ -302,7 +303,7 @@ } }, - "AreaShadeGraph@chocona,tetroctb": { + "AreaShadeGraph@chocona,tetroctb,bramble": { enabled: true }, "AreaShadeGraph@nuritwin,marutaring": { @@ -338,7 +339,7 @@ "AreaStoneGraph@stostone": { coloring: true }, - "AreaUnshadeGraph@heyablock,martini": { + "AreaUnshadeGraph@heyablock,martini,bramble": { enabled: true }, "AreaUnshadeGraph@martini#1": { @@ -357,7 +358,7 @@ "AreaRoomGraph@martini": { hastop: false }, - "AreaShade8Graph@cocktail,martini,tetroctb": { + "AreaShade8Graph@cocktail,martini,tetroctb,bramble": { enabled: true }, @@ -661,7 +662,19 @@ "doneShadingDecided" ] }, - "AnsCheck@shimaguni,stostone,heyablock,cocktail,martini": { + "AnsCheck@bramble#1": { + checklist: [ + "checkShadeCellExist+", + "checkOverShadeCell", + "checkSideAreaShadeCell", + "checkConnectUnshadeOutside", + "checkAdjacentSingle", + "checkShadeCellCount", + "checkConnect8Shade", + "doneShadingDecided" + ] + }, + "AnsCheck@shimaguni,stostone,heyablock,cocktail,martini,bramble": { checkSideAreaShadeCell: function() { this.checkSideAreaCell( function(cell1, cell2) { @@ -1152,6 +1165,66 @@ this.checkOneArea(this.board.sblk8mgr, "csDivide"); } }, + "AnsCheck@bramble": { + checkOverShadeCell: function() { + this.checkAllArea( + this.board.sblkmgr, + function(w, h, a, n) { + return a <= 2; + }, + "csGt2" + ); + }, + checkConnect8Shade: function() { + this.checkOneArea(this.board.sblk8mgr, "csDivide"); + }, + checkAdjacentSingle: function() { + var bd = this.board; + for (var c = 0; c < bd.cell.length; c++) { + var cell = bd.cell[c]; + if (cell.bx >= bd.maxbx - 1 || cell.by >= bd.maxby - 1) { + continue; + } + + var bx = cell.bx, + by = cell.by; + var clist = bd + .cellinside(bx, by, bx + 2, by + 2) + .filter(function(cc) { + return cc.sblk && cc.sblk.clist.length === 1; + }); + if (clist.length !== 2) { + continue; + } + + this.failcode.add("shDiag"); + if (this.checkOnly) { + break; + } + clist.seterr(1); + } + }, + checkConnectUnshadeOutside: function() { + var bd = this.board; + for (var r = 0; r < bd.ublkmgr.components.length; r++) { + var clist = bd.ublkmgr.components[r].clist; + var d = clist.getRectSize(); + if ( + d.x1 === 1 || + d.x2 === bd.maxbx - 1 || + d.y1 === 1 || + d.y2 === bd.maxby - 1 + ) { + continue; + } + this.failcode.add("csLoop"); + if (this.checkOnly) { + break; + } + clist.seterr(1); + } + } + }, FailCode: { bkShadeDivide: "bkShadeDivide", diff --git a/test/script/bramble.js b/test/script/bramble.js new file mode 100644 index 000000000..9c74ab11e --- /dev/null +++ b/test/script/bramble.js @@ -0,0 +1,40 @@ +/* bramble.js */ + +ui.debug.addDebugData("bramble", { + url: "5/5/4cql3su032g222g", + failcheck: [ + [ + "brNoShade", + "pzprv3/bramble/5/5/7/0 0 0 1 1 /0 0 0 2 3 /4 4 4 2 3 /5 5 6 6 3 /5 5 6 6 3 /3 . . 2 . /. . . . 2 /2 . . . . /2 . . . . /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /" + ], + [ + "csGt2", + "pzprv3/bramble/5/5/7/0 0 0 1 1 /0 0 0 2 3 /4 4 4 2 3 /5 5 6 6 3 /5 5 6 6 3 /3 . . 2 . /. . . . 2 /2 . . . . /2 . . . . /. . . . . /# # . # # /. # . . . /# . # . . /. . . . . /# # . . . /" + ], + [ + "shDiag", + "pzprv3/bramble/5/5/7/0 0 0 1 1 /0 0 0 2 3 /4 4 4 2 3 /5 5 6 6 3 /5 5 6 6 3 /3 . . 2 . /. . . . 2 /2 . . . . /2 . . . . /. . . . . /# # . # # /. . # . . /# # . . # /. . # . # /# # . # . /" + ], + [ + "cbShade", + "pzprv3/bramble/5/5/7/0 0 0 1 1 /0 0 0 2 3 /4 4 4 2 3 /5 5 6 6 3 /5 5 6 6 3 /3 . . 2 . /. . . . 2 /2 . . . . /2 . . . . /. . . . . /. . . . . /. . . . . /# . . . . /# . # # . /. # . . . /" + ], + [ + "csLoop", + "pzprv3/bramble/5/5/7/0 0 0 1 1 /0 0 0 2 3 /4 4 4 2 3 /5 5 6 6 3 /5 5 6 6 3 /3 . . 2 . /. . . . 2 /2 . . . . /2 . . . . /. . . . . /. # # . # /# . . # . /. # # . # /# . . . # /# . . . . /" + ], + [ + "bkShadeNe", + "pzprv3/bramble/5/5/7/0 0 0 1 1 /0 0 0 2 3 /4 4 4 2 3 /5 5 6 6 3 /5 5 6 6 3 /3 . . 2 . /. . . . 2 /2 . . . . /2 . . . . /. . . . . /# . . # . /. # # . # /# . . . # /. . # # . /# # . . . /" + ], + [ + "csDivide", + "pzprv3/bramble/5/5/7/0 0 0 1 1 /0 0 0 2 3 /4 4 4 2 3 /5 5 6 6 3 /5 5 6 6 3 /3 . . 2 . /. . . . 2 /2 . . . . /2 . . . . /. . . . . /# # . # # /. . # . . /# # . . . /. . # . # /# # . . # /" + ], + [ + null, + "pzprv3/bramble/5/5/7/0 0 0 1 1 /0 0 0 2 3 /4 4 4 2 3 /5 5 6 6 3 /5 5 6 6 3 /3 . . 2 . /. . . . 2 /2 . . . . /2 . . . . /. . . . . /# # + # # /+ + # + + /# # + + # /+ + # # + /# # + + # /" + ] + ], + inputs: [] +});