|
17 | 17 | "cocktail", |
18 | 18 | "martini", |
19 | 19 | "nuritwin", |
20 | | - "marutaring" |
| 20 | + "marutaring", |
| 21 | + "tetroctb" |
21 | 22 | ], |
22 | 23 | { |
23 | 24 | //--------------------------------------------------------- |
|
37 | 38 | play: ["shade", "unshade", "number"] |
38 | 39 | } |
39 | 40 | }, |
40 | | - "MouseEvent@cocktail,nuritwin,marutaring": { |
| 41 | + "MouseEvent@cocktail,nuritwin,marutaring,tetroctb": { |
41 | 42 | inputModes: { |
42 | 43 | edit: ["border", "number", "clear", "info-blk"], |
43 | 44 | play: ["shade", "unshade", "info-blk"] |
44 | 45 | } |
45 | 46 | }, |
46 | | - "MouseEvent@cocktail,martini#2": { |
| 47 | + "MouseEvent@cocktail,martini,tetroctb#2": { |
47 | 48 | dispInfoBlk: function() { |
48 | 49 | var cell = this.getcell(); |
49 | 50 | this.mousereset(); |
|
123 | 124 | enableSubNumberArray: true, |
124 | 125 | disableAnum: true |
125 | 126 | }, |
126 | | - "Cell@chocona,hinge,heyablock,cocktail": { |
| 127 | + "Cell@chocona,hinge,heyablock,cocktail,tetroctb": { |
127 | 128 | minnum: 0 |
128 | 129 | }, |
129 | 130 | "Cell@martini": { |
|
182 | 183 | Board: { |
183 | 184 | hasborder: 1 |
184 | 185 | }, |
185 | | - "Board@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring": { |
| 186 | + "Board@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring,tetroctb": { |
186 | 187 | addExtraInfo: function() { |
187 | 188 | this.stonegraph = this.addInfoList(this.klass.AreaStoneGraph); |
188 | 189 | } |
|
301 | 302 | } |
302 | 303 | }, |
303 | 304 |
|
304 | | - "AreaShadeGraph@chocona": { |
| 305 | + "AreaShadeGraph@chocona,tetroctb": { |
305 | 306 | enabled: true |
306 | 307 | }, |
307 | 308 | "AreaShadeGraph@nuritwin,marutaring": { |
|
316 | 317 | component.hinge = null; |
317 | 318 | } |
318 | 319 | }, |
319 | | - "AreaStoneGraph:AreaShadeGraph@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring": { |
| 320 | + "AreaStoneGraph:AreaShadeGraph@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring,tetroctb": { |
320 | 321 | // Same as LITS AreaTetrominoGraph |
321 | 322 | enabled: true, |
322 | 323 | relation: { "cell.qans": "node", "border.ques": "separator" }, |
|
356 | 357 | "AreaRoomGraph@martini": { |
357 | 358 | hastop: false |
358 | 359 | }, |
359 | | - "AreaShade8Graph@cocktail,martini": { |
| 360 | + "AreaShade8Graph@cocktail,martini,tetroctb": { |
360 | 361 | enabled: true |
361 | 362 | }, |
362 | 363 |
|
|
647 | 648 | "checkShadeDeadEnd" |
648 | 649 | ] |
649 | 650 | }, |
| 651 | + "AnsCheck@tetroctb#1": { |
| 652 | + checklist: [ |
| 653 | + "checkShadeCellExist+", |
| 654 | + "checkOverShadeCell", |
| 655 | + "checkAdjacentShapes", |
| 656 | + "checkUnderShadeCell", |
| 657 | + |
| 658 | + "checkShadeCellCount", |
| 659 | + "checkBlockHasBorder", |
| 660 | + "checkConnect8Shade", |
| 661 | + "doneShadingDecided" |
| 662 | + ] |
| 663 | + }, |
650 | 664 | "AnsCheck@shimaguni,stostone,heyablock,cocktail,martini": { |
651 | 665 | checkSideAreaShadeCell: function() { |
652 | 666 | this.checkSideAreaCell( |
|
1055 | 1069 | ); |
1056 | 1070 | } |
1057 | 1071 | }, |
| 1072 | + "AnsCheck@tetroctb": { |
| 1073 | + checkOverShadeCell: function() { |
| 1074 | + this.checkAllArea( |
| 1075 | + this.board.sblkmgr, |
| 1076 | + function(w, h, a, n) { |
| 1077 | + return a <= 4; |
| 1078 | + }, |
| 1079 | + "csGt4" |
| 1080 | + ); |
| 1081 | + }, |
| 1082 | + checkUnderShadeCell: function() { |
| 1083 | + this.checkAllArea( |
| 1084 | + this.board.sblkmgr, |
| 1085 | + function(w, h, a, n) { |
| 1086 | + return a >= 4; |
| 1087 | + }, |
| 1088 | + "csLt4" |
| 1089 | + ); |
| 1090 | + }, |
| 1091 | + checkAdjacentShapes: function() { |
| 1092 | + var bd = this.board; |
| 1093 | + for (var c = 0; c < bd.cell.length; c++) { |
| 1094 | + var cell = bd.cell[c]; |
| 1095 | + if (cell.bx === bd.maxbx - 1 || cell.by === bd.maxby - 1) { |
| 1096 | + continue; |
| 1097 | + } |
| 1098 | + |
| 1099 | + var i, |
| 1100 | + adc = cell.adjacent; |
| 1101 | + var cells = [ |
| 1102 | + [cell, adc.right.adjacent.bottom], |
| 1103 | + [adc.right, adc.bottom] |
| 1104 | + ]; |
| 1105 | + for (i = 0; i < 2; i++) { |
| 1106 | + if (cells[i][0].isShade() && cells[i][1].isShade()) { |
| 1107 | + break; |
| 1108 | + } |
| 1109 | + } |
| 1110 | + if (i === 2) { |
| 1111 | + continue; |
| 1112 | + } |
| 1113 | + |
| 1114 | + var block1 = cells[i][0].sblk, |
| 1115 | + block2 = cells[i][1].sblk; |
| 1116 | + if ( |
| 1117 | + block1 === block2 || |
| 1118 | + block1.clist.length !== 4 || |
| 1119 | + this.isDifferentShapeBlock(block1, block2) |
| 1120 | + ) { |
| 1121 | + continue; |
| 1122 | + } |
| 1123 | + |
| 1124 | + this.failcode.add("bsSameShape"); |
| 1125 | + if (this.checkOnly) { |
| 1126 | + break; |
| 1127 | + } |
| 1128 | + block1.clist.seterr(1); |
| 1129 | + block2.clist.seterr(1); |
| 1130 | + } |
| 1131 | + }, |
| 1132 | + checkBlockHasBorder: function() { |
| 1133 | + var areas = this.board.sblkmgr.components; |
| 1134 | + for (var id = 0; id < areas.length; id++) { |
| 1135 | + var area = areas[id], |
| 1136 | + clist = area.clist; |
| 1137 | + if ( |
| 1138 | + clist.length < 4 || |
| 1139 | + clist.length !== clist[0].stone.clist.length |
| 1140 | + ) { |
| 1141 | + continue; |
| 1142 | + } |
| 1143 | + |
| 1144 | + this.failcode.add("bkNoBorder"); |
| 1145 | + if (this.checkOnly) { |
| 1146 | + break; |
| 1147 | + } |
| 1148 | + clist.seterr(1); |
| 1149 | + } |
| 1150 | + }, |
| 1151 | + checkConnect8Shade: function() { |
| 1152 | + this.checkOneArea(this.board.sblk8mgr, "csDivide"); |
| 1153 | + } |
| 1154 | + }, |
1058 | 1155 |
|
1059 | 1156 | FailCode: { |
1060 | 1157 | bkShadeDivide: "bkShadeDivide", |
|
0 commit comments