Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Inaba's Island #589

Merged
merged 8 commits into from
Jan 13, 2025
Merged
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
2 changes: 1 addition & 1 deletion src-ui/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
<main>
<div style="margin-bottom: 5px;"><b>Latest types</b> (<em><a href="/list.html" target="_parent">all types</a></em>)</div>
<ul>
<li><a href="/p?island" target="_parent">Inaba's Island アイランド</a></li>
<li><a href="/p?balloon" target="_parent">Balloon Box 風船箱</a></li>
<li><a href="/p?mintonette" target="_parent">Mintonette</a></li>
<li><a href="/p?nibunnogo" target="_parent">Nibun-nogo ニブンノゴ</a></li>
<li><a href="/p?timebomb" target="_parent">Time Bomb 時限爆弾</a></li>
<li><a href="/p?archipelago" target="_parent">Archipelago アーキペラゴ</a></li>
<li><a href="/p?yajirushi2" target="_parent">Yajirushi 2 見つめあう矢印2</a></li>
<li><a href="/p?swslither" target="_parent">Sheep Wolf Slitherlink</a></li>
</ul>
</main>
</body>
Binary file added src-ui/img/island.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/KeyPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ ui.keypopup = {
timebomb: [10, 0],
smullyan: [10, 0],
meidjuluk: [10, 0],
island: [10, 0],
archipelago: [10, 0],
yajirushi2: [4, 0],
nibunnogo: [4, 0],
Expand Down
15 changes: 8 additions & 7 deletions src-ui/js/ui/Misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,10 @@ function toBGimage(pid) {
"akichi",
"alter",
"angleloop",
"archipelago",
"aquapelago",
"aquarium",
"araf",
"skyscrapers",
"archipelago",
"balance",
"balloon",
"batten",
Expand Down Expand Up @@ -146,14 +145,15 @@ function toBGimage(pid) {
"heyapin",
"icewalk",
"invlitso",
"ladders",
"lixloop",
"island",
"kaidan",
"kaisu",
"kissing",
"kropki",
"kuroclone",
"kuromenbun",
"ladders",
"lixloop",
"lollipops",
"magnets",
"mannequin",
Expand All @@ -170,9 +170,9 @@ function toBGimage(pid) {
"nondango",
"nonogram",
"norinuri",
"nothing",
"nurimisaki",
"nuriuzu",
"nothing",
"oneroom",
"ovotovata",
"oyakodori",
Expand All @@ -184,8 +184,8 @@ function toBGimage(pid) {
"portal",
"ququ",
"rassi",
"remlen",
"regional-poly",
"remlen",
"retroships",
"roundtrip",
"sananko",
Expand All @@ -194,6 +194,7 @@ function toBGimage(pid) {
"scrin",
"simplegako",
"simpleloop",
"skyscrapers",
"slashpack",
"smullyan",
"snake",
Expand All @@ -202,7 +203,6 @@ function toBGimage(pid) {
"starbattle",
"statuepark",
"subomino",
"wafusuma",
"swslither",
"symmarea",
"tachibk",
Expand All @@ -220,6 +220,7 @@ function toBGimage(pid) {
"turnaround",
"voxas",
"vslither",
"wafusuma",
"walllogic",
"waterwalk",
"wittgen",
Expand Down
1 change: 1 addition & 0 deletions src-ui/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
<li data-pid="snakeegg"></li>
<li data-pid="archipelago"></li>
<li data-pid="nibunnogo"></li>
<li data-pid="island"></li>
</ul>
</div>
<div class="lists blocks">
Expand Down
3 changes: 2 additions & 1 deletion src/pzpr/variety.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
],
interbd: [0, 0, "International Borders", "International Borders"],
invlitso: [0, 0, "Inverse LITSO", "Inverse LITSO", "lits"],
island: [0, 0, "アイランド", "Inaba's Island", "kurotto"],
juosan: [0, 0, "縦横さん", "Juosan"],
kaero: [1, 0, "お家に帰ろう", "Return Home"],
kaidan: [0, 0, "かいだんしばり", "Stairwell"],
Expand Down Expand Up @@ -374,7 +375,7 @@
scrin: [0, 0, "スクリン", "Scrin"],
shakashaka: [0, 1, "シャカシャカ", "Shakashaka"],
shikaku: [0, 1, "四角に切れ", "Shikaku", "shikaku"],
shimaguni: [1, 0, "島国", "Islands", "shimaguni"],
shimaguni: [1, 0, "島国", "Shimaguni", "shimaguni"],
shugaku: [1, 0, "修学旅行の夜", "School Trip"],
shwolf: [0, 0, "ヤギとオオカミ", "Goats and Wolves", "kramma"],
simplegako: [0, 0, "シンプルガコ", "Simple Gako"],
Expand Down
2 changes: 1 addition & 1 deletion src/res/failcode.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@
"nmSumOfDiff.bosanowa": "Sum of the differences between the number and adjacent numbers is not equal to the number.",
"nmSumRowNe.kakuro": "The sum of the cells is not correct.",
"nmSumRowShadeNe.box": "A number is not equal to the sum of the number of shaded cells.",
"nmSumSizeNe.kurotto": "The number is not equal to sum of adjacent masses of shaded cells.",
"nmSumSizeNe.kurotto": "A number doesn't indicate the sum of the size of the adjacent blocks.",
"nmSumSizeNe.tasquare": "Sum of the adjacent masses of shaded cells is not equal to the number.",
"nmSumViewNe.teri": "The size of the largest possible rectangle is not equal to the number.",
"nmSumViewNe.view": "Sum of four-way gaps to another number is not equal to the number.",
Expand Down
95 changes: 89 additions & 6 deletions src/variety/kurotto.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
} else {
pzpr.classmgr.makeCustom(pidlist, classbase);
}
})(["kurotto", "mines"], {
})(["kurotto", "mines", "island"], {
//---------------------------------------------------------
// マウス入力系
MouseEvent: {
Expand Down Expand Up @@ -40,6 +40,22 @@
this.mousereset();
}
},
"MouseEvent@island": {
inputModes: {
edit: ["number", "clear"],
play: ["shade", "unshade", "info-blk"]
},
dispInfoBlk: function() {
var cell = this.getcell();
this.mousereset();
if (cell.isnull || !cell.island) {
return;
}
cell.island.clist.setinfo(1);
this.board.hasinfo = true;
this.puzzle.redraw();
}
},

//---------------------------------------------------------
// キーボード入力系
Expand Down Expand Up @@ -67,7 +83,12 @@
return this.checkComplete();
}
},
"Cell@kurotto": {
"Board@island": {
addExtraInfo: function() {
this.islandgraph = this.addInfoList(this.klass.AreaIslandGraph);
}
},
"Cell@kurotto,island": {
maxnum: function() {
var max = this.board.cell.length - 1;
return max <= 999 ? max : 999;
Expand Down Expand Up @@ -131,9 +152,27 @@
}
},

"AreaShadeGraph@kurotto": {
"AreaShadeGraph@kurotto,island": {
enabled: true
},
"AreaIslandGraph:AreaShadeGraph@island": {
enabled: true,
coloring: true,
relation: { "cell.qans": "node", "cell.qnum": "node" },
setComponentRefs: function(obj, component) {
obj.island = component;
},
getObjNodeList: function(nodeobj) {
return nodeobj.islandnodes;
},
resetObjNodeList: function(nodeobj) {
nodeobj.islandnodes = [];
},

isnodevalid: function(cell) {
return cell.isShade() || cell.isNum();
}
},

//---------------------------------------------------------
// 画像表示系
Expand All @@ -156,7 +195,7 @@
this.common.setRange.call(this, x1, y1, x2, y2);
}
},
"Graphic@kurotto": {
"Graphic@kurotto,island": {
hideHatena: true,

numbercolor_func: "qnum",
Expand All @@ -183,6 +222,43 @@
return null;
}
},
"Graphic@island#1": {
irowakeblk: true,

getCircleFillColor: function(cell) {
if (!cell.isCmp()) {
return null;
}
var hasinfo = this.board.haserror || this.board.hasinfo;
if (this.puzzle.execConfig("irowakeblk") && !hasinfo) {
var color = cell.island.color;
if (typeof color !== "string") {
return color;
}

return color.replace("rgb", "rgba").replace(")", ",0.25)");
}
return this.qcmpcolor;
},

getShadedCellColor: function(cell) {
if (cell.qans !== 1) {
return null;
}
var hasinfo = this.board.haserror || this.board.hasinfo;
var info = cell.error || cell.qinfo;
if (info === 1) {
return this.errcolor1;
} else if (info === 2) {
return this.errcolor2;
} else if (cell.trial) {
return this.trialcolor;
} else if (this.puzzle.execConfig("irowakeblk") && !hasinfo) {
return cell.island.color;
}
return this.shadecolor;
}
},
"Graphic@mines": {
qcmpcolor: "rgb(127,127,127)",

Expand Down Expand Up @@ -260,11 +336,18 @@
}
}
},
"AnsCheck@kurotto": {
checklist: ["checkShadeCellExist", "checkCellNumber_kurotto"],
"AnsCheck@kurotto,island": {
checklist: [
"checkShadeCellExist",
"checkCellNumber_kurotto",
"checkConnectShaded_island@island"
],

checkCellNumber_kurotto: function() {
this.checkCellNumber("nmSumSizeNe");
},
checkConnectShaded_island: function() {
this.checkOneArea(this.board.islandgraph, "csDivide");
}
},
"AnsCheck@mines": {
Expand Down
47 changes: 47 additions & 0 deletions test/script/island.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* island.js */

ui.debug.addDebugData("island", {
url: "5/5/1g6m2i3h4m",
failcheck: [
[
"brNoShade",
"pzprv3/island/5/5/1 . 6 . . /. . . . . /2 . . . 3 /. . 4 . . /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /"
],
[
"nmSumSizeNe",
"pzprv3/island/5/5/1 . 6 . . /. . . . . /2 . . . 3 /. . 4 . . /. . . . . /. # . # # /+ + # . . /. + # # . /# # . + + /. . . . + /"
],
[
"csDivide",
"pzprv3/island/5/5/1 . 6 . . /. . . . . /2 . . . 3 /. . 4 . . /. . . . . /. # . # # /+ + # + # /. + # + . /# . . + + /# + # # + /"
],
[
null,
"pzprv3/island/5/5/1 . 6 . . /. . . . . /2 . . . 3 /. . 4 . . /. . . . . /. # . # # /+ + # + # /. + # + . /# # . + + /+ + + + + /"
]
],
inputs: [
{ input: ["newboard,5,1", "editmode"] },
{
input: [
"cursor,3,1",
"key,1",
"cursor,9,1",
"key,1",
"playmode",
"mouse,left,1,1,5,1"
],
result: "pzprv3/island/1/5/. 1 . . 1 /# . # . . /"
},
{
input: ["playmode,info-blk", "mouse,left,3,1"],
result: function(puzzle, assert) {
var bd = puzzle.board;
assert.equal(bd.getc(1, 1).qinfo, 1);
assert.equal(bd.getc(3, 1).qinfo, 1);
assert.equal(bd.getc(5, 1).qinfo, 1);
assert.equal(bd.getc(9, 1).qinfo, 0);
}
}
]
});
Loading