Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src-ui/js/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
"kakuro",
"sudoku",
"fillomino",
"symmarea",
"ripple",
"akari",
"shakashaka"
Expand Down
1 change: 1 addition & 0 deletions src-ui/js/ui/KeyPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ ui.keypopup = {
tateyoko: [10, 0],
factors: [10, 10],
fillomino: [10, 10],
symmarea: [10, 10],
renban: [10, 10],
ripple: [10, 10],
cojun: [10, 10],
Expand Down
1 change: 1 addition & 0 deletions src-ui/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
<ul>
<li data-pid="sudoku"></li>
<li data-pid="fillomino"></li>
<li data-pid="symmarea"></li>
<li data-pid="ripple"></li>
<li data-pid="factors"></li>
<li data-pid="makaro"></li>
Expand Down
2 changes: 1 addition & 1 deletion src/puzzle/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
exec = pid === "mashu";
break;
case "forceallcell":
exec = pid === "fillomino";
exec = pid === "fillomino" || pid === "symmarea";
break;
case "dontpassallcell":
exec = pid === "arukone";
Expand Down
1 change: 1 addition & 0 deletions src/pzpr/variety.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@
sudoku: [0, 1, "数独", "Sudoku"],
sukoro: [1, 0, "数コロ", "Sukoro", "sukoro"],
sukororoom: [0, 0, "数コロ部屋", "Sukoro-room", "sukoro"],
symmarea: [0, 0, "シンメトリーエリア", "Symmetry Area", "fillomino"],
tapa: [0, 0, "Tapa", "Tapa"],
tasquare: [0, 0, "たすくえあ", "Tasquare"],
tatamibari: [1, 0, "タタミバリ", "Tatamibari"],
Expand Down
26 changes: 24 additions & 2 deletions src/variety/fillomino.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
} else {
pzpr.classmgr.makeCustom(pidlist, classbase);
}
})(["fillomino"], {
})(["fillomino", "symmarea"], {
//---------------------------------------------------------
// マウス入力系
MouseEvent: {
Expand Down Expand Up @@ -336,6 +336,7 @@
"checkSideAreaNumberSize",
"checkLargeArea",
"checkNumKinds",
"checkRoomSymm@symmarea",
"checkNoNumArea",
"checkNoNumCell_fillomino+"
],
Expand Down Expand Up @@ -370,6 +371,23 @@
return area.numkind >= 1;
}, "bkNoNum");
},
checkRoomSymm: function() {
var board = this.board;
this.checkAllErrorRoom(function(area) {
var clist = area.clist,
d = clist.getRectSize();
var sx = d.x1 + d.x2,
sy = d.y1 + d.y2;
for (var i = 0; i < clist.length; i++) {
var cell = clist[i],
cell2 = board.getc(sx - cell.bx, sy - cell.by);
if (cell2.nblk !== area) {
return false;
}
}
return true;
}, "bkNotSymmRoom");
},
checkAllErrorRoom: function(evalfunc, code) {
var rooms = this.board.numblkgraph.components;
for (var id = 0; id < rooms.length; id++) {
Expand Down Expand Up @@ -405,11 +423,15 @@
],
bkMixedNum: [
"1つのブロックに2種類以上の数字が入っています。",
"A room has two or more kinds of numbers."
"A block has two or more kinds of numbers."
],
bsSameNum: [
"同じ数字のブロックが辺を共有しています。",
"Adjacent blocks have the same number."
],
bkNotSymmRoom: [
"部屋の形が点対称ではありません。",
"The block is not point symmetric."
]
}
});
64 changes: 64 additions & 0 deletions test/script/symmarea.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/* symmarea.js */

ui.debug.addDebugData("symmarea", {
url: "6/6/g1i1g6i82p53i5g1i4g",
failcheck: [
[
"bkSizeLt",
"pzprv3/symmarea/6/6/. 1 . . . 1 /. 6 . . . 8 /2 . . . . . /. . . . . 5 /3 . . . 5 . /1 . . . 4 . /6 . 8 1 8 . /6 . 8 8 8 . /. 6 6 8 1 8 /2 1 6 2 5 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1 1 1 0 1 /1 0 0 1 1 0 /"
],
[
"bkNoNum",
"pzprv3/symmarea/6/6/. 1 . . . 1 /. 6 . . . 8 /2 . . . . . /. . . . . 5 /3 . . . 5 . /1 . . . 4 . /6 . 8 1 8 . /6 . 8 8 8 . /. 6 6 8 5 8 /2 1 6 5 5 . /. 3 3 1 . . /. 4 4 4 . . /1 1 1 1 1 /0 1 0 0 0 /1 0 1 1 1 /1 1 1 0 0 /0 0 1 1 1 /1 0 0 0 1 /0 1 0 1 0 0 /1 0 1 0 1 0 /0 1 0 1 0 1 /1 1 1 1 0 1 /1 1 1 1 1 0 /"
],
[
"ceNoNum",
"pzprv3/symmarea/6/6/. 1 . . . 1 /. 6 . . . 8 /2 . . . . . /. . . . . 5 /3 . . . 5 . /1 . . . 4 . /6 . 8 1 8 . /6 . . . . . /. 6 6 8 5 8 /2 1 6 5 5 . /. 3 3 1 . 2 /. 4 4 4 . 2 /1 1 1 1 1 /0 1 0 0 0 /1 0 1 1 1 /1 1 1 0 0 /0 0 1 1 1 /1 0 0 0 1 /0 1 0 1 0 1 /1 0 1 0 1 0 /0 1 0 1 0 1 /1 1 1 1 0 1 /1 1 1 1 1 0 /"
],
[
"bkNotSymmRoom",
"pzprv3/symmarea/6/6/. 1 . . . 1 /. 6 . . . 8 /2 . . . . . /. . . . . 5 /3 . . . 5 . /1 . . . 4 . /6 . 8 8 8 . /6 . 1 8 8 . /. 6 6 8 5 8 /2 1 6 5 5 . /. 3 3 1 . 2 /. 4 4 4 . 2 /1 1 0 0 1 /0 1 1 0 0 /1 0 1 1 1 /1 1 1 0 0 /0 0 1 1 1 /1 0 0 0 1 /0 1 1 0 0 1 /1 0 1 0 1 0 /0 1 0 1 0 1 /1 1 1 1 0 1 /1 1 1 1 1 0 /"
],
[
null,
"pzprv3/symmarea/6/6/. 1 . . . 1 /. 6 . . . 8 /2 . . . . . /. . . . . 5 /3 . . . 5 . /1 . . . 4 . /6 . 8 1 8 . /6 . 8 8 8 . /. 6 6 8 5 8 /2 1 6 5 5 . /. 3 3 1 . 2 /. 4 4 4 . 2 /1 1 1 1 1 /0 1 0 0 0 /1 0 1 1 1 /1 1 1 0 0 /0 0 1 1 1 /1 0 0 0 1 /0 1 0 1 0 1 /1 0 1 0 1 0 /0 1 0 1 0 1 /1 1 1 1 0 1 /1 1 1 1 1 0 /"
]
],
inputs: [
/* 問題入力はbosanowaと同じなので省略 */
/* 回答入力テスト */
{ input: ["newboard,4,2", "editmode", "cursor,1,1", "key,3", "playmode"] },
{
input: ["mouse,right, 1,1, 5,1"],
result:
"pzprv3/symmarea/2/4/3 . . . /. . . . /. . . . /. . . . /-1 -1 0 /0 0 0 /0 0 0 0 /"
},
{
input: ["mouse,left, 1,1, 5,1"],
result:
"pzprv3/symmarea/2/4/3 . . . /. . . . /. 3 3 . /. . . . /-1 -1 0 /0 0 0 /0 0 0 0 /"
},
{
input: ["mouse,left, 7,1, 1,1"],
result:
"pzprv3/symmarea/2/4/3 . . . /. . . . /. . . . /. . . . /-1 -1 0 /0 0 0 /0 0 0 0 /"
},
{
input: ["mouse,left, 2,0, 2,2, 0,2"],
result:
"pzprv3/symmarea/2/4/3 . . . /. . . . /. . . . /. . . . /2 -1 0 /0 0 0 /1 0 0 0 /"
}
]
});