Skip to content

Commit b85e2f3

Browse files
committed
Add Bramble
1 parent 12c6b97 commit b85e2f3

7 files changed

Lines changed: 128 additions & 11 deletions

File tree

src-ui/js/ui/KeyPopup.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ ui.keypopup = {
250250
heavydots: [10, 0],
251251
marutaring: [10, 0],
252252
tetroctb: [10, 0],
253-
hasunomura: [10, 0]
253+
hasunomura: [10, 0],
254+
bramble: [10, 0]
254255
},
255256

256257
//---------------------------------------------------------------------------

src-ui/list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
102102
<li data-pid="nuritwin"></li>
103103
<li data-pid="marutaring"></li>
104104
<li data-pid="tetroctb"></li>
105+
<li data-pid="bramble"></li>
105106
</ul>
106107
</div>
107108
<div class="lists blocks">

src/pzpr/variety.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
bosanowa: [1, 0, "ボサノワ", "Bosanowa", "", { alias: "bossanova" }],
113113
bosnianroad: [0, 0, "Bosnian Road", "Bosnian Road"],
114114
box: [0, 0, "ボックス", "Box"],
115+
bramble: [0, 0, "Bramble", "Bramble", "shimaguni"],
115116
brownies: [0, 0, "ブラウニー", "Brownies", "yosenabe"],
116117
bunnyhop: [0, 0, "Bunnyhop", "Bunnyhop", "", { alias: "bnuuyhop" }],
117118
cave: [1, 0, "バッグ", "Cave", "kurodoko", { alias: "bag" }],

src/res/failcode.en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@
457457
"csGt4": "The size of a mass of shaded cells is over four.",
458458
"csGtLimit.kissing": "Two blocks are adjacent in an invalid location.",
459459
"csGtN.isowatari": "The size of a mass of shaded cells is greater than the indicated number.",
460-
"csLoop.parquet": "There is a loop of shaded cells.",
460+
"csLoop": "There is a loop of shaded cells.",
461461
"csLt1.edamame": "A rectangle has no circle in the middle.",
462462
"csLt1.nothree": "A dot doesn't overlap a shaded cell.",
463463
"csLt1.sumiwake": "A circle doesn't overlap a shaded cell.",
@@ -935,6 +935,7 @@
935935
"shDiag.batten": "A checkerboard pattern isn't marked with a clue.",
936936
"shDiag.battleship": "Two ships are diagonally adjacent.",
937937
"shDiag.bosnianroad": "The loop touches itself diagonally.",
938+
"shDiag.bramble": "Two single-cell blocks are diagonally adjacent.",
938939
"shDiag.pentatouch": "A place where two pieces touch isn't marked with a point.",
939940
"shDiag.snake": "The snake touches itself diagonally.",
940941
"shDiag": "Two pieces are diagonally adjacent.",

src/res/failcode.ja.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@
318318
"csDivide": "黒マスが分断されています。",
319319
"csDivide8.mochikoro": "孤立した白マスのブロックがあります。",
320320
"csGt2": "2マスより大きい黒マスのカタマリがあります。",
321-
"csLoop.parquet": "黒マスがループになっています。",
321+
"csLoop": "黒マスがループになっています。",
322322
"csLt2": "1マスだけの黒マスのカタマリがあります。",
323323
"csNoLevel.aquarium": "ひとつながりの水のマスの水位が等しくなっていません。",
324324
"csNoSupport.aquarium": "水の入っているマスの隣や下のマスが空白になっています。",

src/variety/shimaguni.js

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"martini",
1919
"nuritwin",
2020
"marutaring",
21-
"tetroctb"
21+
"tetroctb",
22+
"bramble"
2223
],
2324
{
2425
//---------------------------------------------------------
@@ -38,13 +39,13 @@
3839
play: ["shade", "unshade", "number"]
3940
}
4041
},
41-
"MouseEvent@cocktail,nuritwin,marutaring,tetroctb": {
42+
"MouseEvent@cocktail,nuritwin,marutaring,tetroctb,bramble": {
4243
inputModes: {
4344
edit: ["border", "number", "clear", "info-blk"],
4445
play: ["shade", "unshade", "info-blk"]
4546
}
4647
},
47-
"MouseEvent@cocktail,martini,tetroctb#2": {
48+
"MouseEvent@cocktail,martini,tetroctb,bramble#2": {
4849
dispInfoBlk: function() {
4950
var cell = this.getcell();
5051
this.mousereset();
@@ -124,7 +125,7 @@
124125
enableSubNumberArray: true,
125126
disableAnum: true
126127
},
127-
"Cell@chocona,hinge,heyablock,cocktail,tetroctb": {
128+
"Cell@chocona,hinge,heyablock,cocktail,tetroctb,bramble": {
128129
minnum: 0
129130
},
130131
"Cell@martini": {
@@ -302,7 +303,7 @@
302303
}
303304
},
304305

305-
"AreaShadeGraph@chocona,tetroctb": {
306+
"AreaShadeGraph@chocona,tetroctb,bramble": {
306307
enabled: true
307308
},
308309
"AreaShadeGraph@nuritwin,marutaring": {
@@ -338,7 +339,7 @@
338339
"AreaStoneGraph@stostone": {
339340
coloring: true
340341
},
341-
"AreaUnshadeGraph@heyablock,martini": {
342+
"AreaUnshadeGraph@heyablock,martini,bramble": {
342343
enabled: true
343344
},
344345
"AreaUnshadeGraph@martini#1": {
@@ -357,7 +358,7 @@
357358
"AreaRoomGraph@martini": {
358359
hastop: false
359360
},
360-
"AreaShade8Graph@cocktail,martini,tetroctb": {
361+
"AreaShade8Graph@cocktail,martini,tetroctb,bramble": {
361362
enabled: true
362363
},
363364

@@ -661,7 +662,19 @@
661662
"doneShadingDecided"
662663
]
663664
},
664-
"AnsCheck@shimaguni,stostone,heyablock,cocktail,martini": {
665+
"AnsCheck@bramble#1": {
666+
checklist: [
667+
"checkShadeCellExist+",
668+
"checkOverShadeCell",
669+
"checkSideAreaShadeCell",
670+
"checkConnectUnshadeOutside",
671+
"checkAdjacentSingle",
672+
"checkShadeCellCount",
673+
"checkConnect8Shade",
674+
"doneShadingDecided"
675+
]
676+
},
677+
"AnsCheck@shimaguni,stostone,heyablock,cocktail,martini,bramble": {
665678
checkSideAreaShadeCell: function() {
666679
this.checkSideAreaCell(
667680
function(cell1, cell2) {
@@ -1152,6 +1165,66 @@
11521165
this.checkOneArea(this.board.sblk8mgr, "csDivide");
11531166
}
11541167
},
1168+
"AnsCheck@bramble": {
1169+
checkOverShadeCell: function() {
1170+
this.checkAllArea(
1171+
this.board.sblkmgr,
1172+
function(w, h, a, n) {
1173+
return a <= 2;
1174+
},
1175+
"csGt2"
1176+
);
1177+
},
1178+
checkConnect8Shade: function() {
1179+
this.checkOneArea(this.board.sblk8mgr, "csDivide");
1180+
},
1181+
checkAdjacentSingle: function() {
1182+
var bd = this.board;
1183+
for (var c = 0; c < bd.cell.length; c++) {
1184+
var cell = bd.cell[c];
1185+
if (cell.bx >= bd.maxbx - 1 || cell.by >= bd.maxby - 1) {
1186+
continue;
1187+
}
1188+
1189+
var bx = cell.bx,
1190+
by = cell.by;
1191+
var clist = bd
1192+
.cellinside(bx, by, bx + 2, by + 2)
1193+
.filter(function(cc) {
1194+
return cc.sblk && cc.sblk.clist.length === 1;
1195+
});
1196+
if (clist.length !== 2) {
1197+
continue;
1198+
}
1199+
1200+
this.failcode.add("shDiag");
1201+
if (this.checkOnly) {
1202+
break;
1203+
}
1204+
clist.seterr(1);
1205+
}
1206+
},
1207+
checkConnectUnshadeOutside: function() {
1208+
var bd = this.board;
1209+
for (var r = 0; r < bd.ublkmgr.components.length; r++) {
1210+
var clist = bd.ublkmgr.components[r].clist;
1211+
var d = clist.getRectSize();
1212+
if (
1213+
d.x1 === 1 ||
1214+
d.x2 === bd.maxbx - 1 ||
1215+
d.y1 === 1 ||
1216+
d.y2 === bd.maxby - 1
1217+
) {
1218+
continue;
1219+
}
1220+
this.failcode.add("csLoop");
1221+
if (this.checkOnly) {
1222+
break;
1223+
}
1224+
clist.seterr(1);
1225+
}
1226+
}
1227+
},
11551228

11561229
FailCode: {
11571230
bkShadeDivide: "bkShadeDivide",

test/script/bramble.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* bramble.js */
2+
3+
ui.debug.addDebugData("bramble", {
4+
url: "5/5/4cql3su032g222g",
5+
failcheck: [
6+
[
7+
"brNoShade",
8+
"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 . . . . /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /"
9+
],
10+
[
11+
"csGt2",
12+
"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 . . . . /. . . . . /# # . # # /. # . . . /# . # . . /. . . . . /# # . . . /"
13+
],
14+
[
15+
"shDiag",
16+
"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 . . . . /. . . . . /# # . # # /. . # . . /# # . . # /. . # . # /# # . # . /"
17+
],
18+
[
19+
"cbShade",
20+
"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 . . . . /. . . . . /. . . . . /. . . . . /# . . . . /# . # # . /. # . . . /"
21+
],
22+
[
23+
"csLoop",
24+
"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 . . . . /. . . . . /. # # . # /# . . # . /. # # . # /# . . . # /# . . . . /"
25+
],
26+
[
27+
"bkShadeNe",
28+
"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 . . . . /. . . . . /# . . # . /. # # . # /# . . . # /. . # # . /# # . . . /"
29+
],
30+
[
31+
"csDivide",
32+
"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 . . . . /. . . . . /# # . # # /. . # . . /# # . . . /. . # . # /# # . . # /"
33+
],
34+
[
35+
null,
36+
"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 . . . . /. . . . . /# # + # # /+ + # + + /# # + + # /+ + # # + /# # + + # /"
37+
]
38+
],
39+
inputs: []
40+
});

0 commit comments

Comments
 (0)