Skip to content

Commit

Permalink
Add Aquapelago
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ender authored Sep 18, 2023
1 parent d2756a1 commit 7275403
Show file tree
Hide file tree
Showing 14 changed files with 392 additions and 5 deletions.
Binary file added src-ui/img/aquapelago.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src-ui/js/ui/Misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ function toBGimage(pid) {
var imgs = [
"akichi",
"angleloop",
"aquapelago",
"aquarium",
"araf",
"skyscrapers",
Expand Down
1 change: 1 addition & 0 deletions src-ui/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
<li data-pid="context"></li>
<li data-pid="akichi"></li>
<li data-pid="guidearrow"></li>
<li data-pid="aquapelago"></li>
</ul>
</div>
<div class="lists loops">
Expand Down
1 change: 1 addition & 0 deletions src-ui/res/history.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ amibo: "This genre first appeared in Puzzle Communication Nikoli vol. 134."
angleloop: ""
anglers: ""
aqre: "This genre was invented by Eric Fox."
aquapelago: "This genre was invented by Walker Anderson."
aquarium: "This genre was invented by Inaba Naoki."
araf: ""
armyants: "This genre first appeared in Puzzle Communication Nikoli vol. 158."
Expand Down
1 change: 1 addition & 0 deletions src-ui/res/history.ja.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,4 @@ heteromino: 稲葉直貴氏発案
waterwalk: Martin Ender (Menderbug)氏発案
mannequin: パズル通信ニコリ vol.114より
kurotto: パズル通信ニコリ vol.138より
aquapelago: Walker Anderson氏発案
1 change: 1 addition & 0 deletions src-ui/res/rules.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,4 @@ wittgen: "Place several rectangles of size 1x3 into the grid.\n1. A number indic
mannequin: "Shade exactly two cells in each outlined region.\n1. A number indicates how many empty cells are between the two shaded cells in the region, when following the shortest possible path between the cells that does not cross any region borders.\n2. Two regions which share a border must have different numbers.\n3. All unshaded cells form an orthogonally connected area."
kaisu: "Draw a path from S to G that goes through all cells.\n1. The path cannot branch off or cross itself.\n2. An outlined region can be entered and exited multiple times. On the region's Nth visit the line must go through exactly N circles, or go through no circles."
tachibk: "Draw lines over the dotted lines to divide the two grids into several blocks.\n1. A number indicates the size of the block in cells. A block can contain one or more numbers, or none at all.\n2. Both grids must be divided into the same set of blocks, counting rotations and reflections as the same.\n3. When the two grids are overlaid on top of each other (without rotation or reflection), a block cannot overlap another block of the same size."
aquapelago: "Shade some cells on the board. Some shaded cells may be given.\n1. Shaded cells cannot be horizontally or vertically adjacent.\n2. The unshaded cells cannot form a 2x2 square.\n3. A number indicates the amount of cells in its diagonally connected group of shaded cells.\n4. All unshaded cells on the board form an orthogonally connected area."
1 change: 1 addition & 0 deletions src-ui/res/rules.ja.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,4 @@ tetrominous: "点線に沿って線を引き、盤面をテトロミノ(4マ
waterwalk: "1. いくつかのマスを通る枝分かれや交差のない一つのループを作りましょう。\n2. 青色のマスは水を表し、残りのマスは陸を表します。ループは水のマスを3マス以上連続して通過してはいけません。\n3. 数字のマスは必ず線が通り、数字は、線が陸のマスに入ってからその数字を通り海に出るまでに通る白色のマスの数を表します。"
kaisu: "1. SからGまで1本のルートを引きましょう。Sが始点、Gが終点です。\n2. ルートは全てのマスを通り、途中で途切れたり自身の線と交差してはいけません。\n3. 区切られた領域内の白丸を通る場合は、その領域を通るのがX回目のときにちょうどX個の白丸を通らなければなりません。"
tachibk: "1. 点線上に線を引き、盤面をいくつかのブロックに切り分けましよう。\n2. 左半分の盤面のブロックを並び替えると、右半分の盤面になるようにします。並び替えるときにそれぞれのブロックを 回転させたり衷返したりしてもかまいません。\n3. 数字は、その数字が入るブロックのマス数を表します。1つのブロックに、いくつ数字が入つてもかまいません。\n4. 左右の盤面の同じ位遛に当たるマスを、同じマス数のブロックにしてはいけません。"
aquapelago: ""
16 changes: 16 additions & 0 deletions src/puzzle/Piece.js
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ pzpr.classmgr.makeCommon({
// cell.getdir4clist() 上下左右4方向の存在するセルを返す
// cell.getdir4cblist() 上下左右4方向のセル&境界線&方向を返す
// cell.getdir8clist() Get orthogonally and diagonally adjacent cells
// cell.getdiagclist() Get diagonally adjacent cells
//---------------------------------------------------------------------------
getdir4clist: function() {
var adc = this.adjacent,
Expand Down Expand Up @@ -736,6 +737,21 @@ pzpr.classmgr.makeCommon({
}
return list;
},
getdiagclist: function() {
var list = [];
var cells = [
this.relcell(-2, -2),
this.relcell(2, -2),
this.relcell(-2, 2),
this.relcell(2, 2)
];
for (var i = 0; i < 4; i++) {
if (cells[i].group === "cell" && !cells[i].isnull) {
list.push([cells[i], i + 1]);
}
}
return list;
},

//------------------------------------------------------------------------------------
// cell.getOrthogonalCell() Get an adjacent cell in the direction of the target cell.
Expand Down
14 changes: 9 additions & 5 deletions src/puzzle/PieceList.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,16 @@ pzpr.classmgr.makeCommon({
var ret = null;
for (var i = 0, len = this.length; i < len; i++) {
if (this[i].isNum()) {
if (!this.singleQnumCell) {
return this[i];
}
if (ret) {
return this.board.emptycell;
if (this.singleQnumCell) {
if (ret) {
return this.board.emptycell;
}
} else {
if (this[i].qnum !== -2) {
return this[i];
}
}

ret = this[i];
}
}
Expand Down
1 change: 1 addition & 0 deletions src/pzpr/variety.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
anglers: [0, 0, "フィッシング", "Anglers"],
antmill: [0, 0, "Ant Mill", "Ant Mill", "scrin"],
aqre: [0, 0, "Aqre", "Aqre", "aqre"],
aquapelago: [0, 0, "Aquapelago", "Aquapelago"],
aquarium: [0, 0, "アクアプレース", "Aquarium", "aquarium"],
araf: [0, 0, "相ダ部屋", "Araf", "araf"],
armyants: [0, 0, "ぐんたいあり", "Army Ants", "kaero"],
Expand Down
3 changes: 3 additions & 0 deletions src/res/failcode.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
"bkSize1.rectslider": "There is an isolated shaded cell.",
"bkSize1.yajitatami": "The length of the tatami is one.",
"bkSizeEq.fillmat": "The number is equal to the size of the tatami.",
"bkSizeGt.aquapelago": "A group of shaded cells is larger than the number.",
"bkSizeGt.dbchoco": "A number is smaller than the size of the shape.",
"bkSizeGt.fillomino": "A number is smaller than the size of the area.",
"bkSizeGt.icewalk": "A section of unshaded cells is longer than the number.",
Expand All @@ -245,6 +246,7 @@
"bkSizeGt3": "The size of an area is larger than three.",
"bkSizeGt4": "The size of an area is larger than four.",
"bkSizeGt5": "The size of an area is larger than five.",
"bkSizeLt.aquapelago": "A group of shaded cells is smaller than the number.",
"bkSizeLt.dbchoco": "A number is bigger than the size of the shape.",
"bkSizeLt.fillomino": "A number is bigger than the size of the area.",
"bkSizeLt.icewalk": "A section of unshaded cells is shorter than the number.",
Expand Down Expand Up @@ -654,6 +656,7 @@
"nmMinesNe.mines": "The number of mines in the surrounding cells is not equal to the number.",
"nmMissing.lohkous": "There is no segment of the given length in the room.",
"nmMissRow.easyasabc": "There are missing letters in a row or column.",
"nmMixed.aquapelago": "A group contains different numbers.",
"nmMoveNe.tren": "A block cannot move in the correct number of spaces.",
"nmNoLine.amibo": "No bar connects to a white circle.",
"nmNoLine.coffeemilk": "A white or black circle doesn't have a line.",
Expand Down
5 changes: 5 additions & 0 deletions src/variety-common/Answer.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ pzpr.classmgr.makeCommon({
return cell.isShade();
}, "cs2x2");
},
check2x2UnshadeCell: function() {
this.check2x2Block(function(cell) {
return cell.isUnshade();
}, "cu2x2");
},

//---------------------------------------------------------------------------
// ans.checkSameColorTile() 白マスと黒マスが混ざったタイルがないかどうかチェックする
Expand Down
Loading

1 comment on commit 7275403

@vercel
Copy link

@vercel vercel bot commented on 7275403 Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pzprjs – ./

pzprjs-robx.vercel.app
pzprjs-git-main-robx.vercel.app
pzprjs.vercel.app

Please sign in to comment.