|
15 | 15 | "mochinyoro", |
16 | 16 | "canal", |
17 | 17 | "norinuri", |
18 | | - "cornerch" |
| 18 | + "cornerch", |
| 19 | + "hasunomura" |
19 | 20 | ], |
20 | 21 | { |
21 | 22 | //--------------------------------------------------------- |
|
26 | 27 | autoedit_func: "qnum", |
27 | 28 | autoplay_func: "cell" |
28 | 29 | }, |
29 | | - "MouseEvent@nurikabe": { |
| 30 | + "MouseEvent@nurikabe,hasunomura": { |
30 | 31 | inputModes: { |
31 | 32 | edit: ["number", "clear", "info-blk"], |
32 | 33 | play: ["shade", "unshade", "info-blk"] |
|
239 | 240 | this.drawTarget(); |
240 | 241 | } |
241 | 242 | }, |
242 | | - "Graphic@nuribou,mochikoro,mochinyoro,norinuri,cornerch": { |
| 243 | + "Graphic@nuribou,mochikoro,mochinyoro,norinuri,cornerch,hasunomura": { |
243 | 244 | bgcellcolor_func: "qsub1", |
244 | 245 | enablebcolor: true |
245 | 246 | }, |
|
431 | 432 | "doneShadingDecided" |
432 | 433 | ] |
433 | 434 | }, |
| 435 | + "AnsCheck@hasunomura#1": { |
| 436 | + checklist: [ |
| 437 | + "checkShadeCellExist", |
| 438 | + "check2x2ShadeCell", |
| 439 | + "checkDiagonalSums", |
| 440 | + "checkConnectShade", |
| 441 | + "doneShadingDecided" |
| 442 | + ] |
| 443 | + }, |
434 | 444 | AnsCheck: { |
435 | 445 | checkDoubleNumberInUnshade: function() { |
436 | 446 | this.checkAllBlock( |
|
615 | 625 | ); |
616 | 626 | } |
617 | 627 | }, |
| 628 | + "AnsCheck@hasunomura": { |
| 629 | + checkDiagonalSums: function() { |
| 630 | + this.checkAllCell(function(cell) { |
| 631 | + if (!cell.isValidNum()) { |
| 632 | + return false; |
| 633 | + } |
| 634 | + |
| 635 | + var set = new Set(); |
| 636 | + for (var dy = -2; dy <= 2; dy += 4) { |
| 637 | + for (var dx = -2; dx <= 2; dx += 4) { |
| 638 | + var room = cell.relcell(dx, dy).ublk; |
| 639 | + if (room) { |
| 640 | + set.add(room); |
| 641 | + } |
| 642 | + } |
| 643 | + } |
| 644 | + |
| 645 | + var count = 0; |
| 646 | + set.forEach(function(block) { |
| 647 | + count += block.clist.length; |
| 648 | + }); |
| 649 | + |
| 650 | + return cell.getNum() !== count; |
| 651 | + }, "bkSizeNe"); |
| 652 | + } |
| 653 | + }, |
618 | 654 | "FailCode@mochikoro,mochinyoro": { |
619 | 655 | cuNotRect: "cuNotRect.mochikoro", |
620 | 656 | csRect: "csRect.mochikoro", |
|
0 commit comments