Skip to content
Open
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
Binary file added src-ui/img/circuitwalk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src-ui/js/ui/KeyPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ ui.keypopup = {
cityspace: [10, 0],
diamond: [4, 0],
sendai: [10, 0],
circuitwalk: [10, 0],
morningwalk: [10, 0],
energywalk: [10, 0],
keywest: [4, 4]
Expand Down Expand Up @@ -509,6 +510,7 @@ ui.keypopup = {
pid === "forestwalk" ||
pid === "morningwalk" ||
pid === "energywalk" ||
pid === "circuitwalk" ||
pid === "dbchoco" ||
pid === "balloon"
) {
Expand All @@ -527,6 +529,8 @@ ui.keypopup = {
? "rgb(212,180,212)"
: pid === "energywalk"
? "rgb(255,255,163)"
: pid === "circuitwalk"
? "rgb(118,165,175)"
: "rgb(192,224,255)"
}
]);
Expand Down
1 change: 1 addition & 0 deletions src-ui/js/ui/Misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ function toBGimage(pid) {
"cbanana",
"chainedb",
"circlesquare",
"circuitwalk",
"cityspace",
"cocktail",
"coffeemilk",
Expand Down
1 change: 1 addition & 0 deletions src-ui/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
<li data-pid="icelom"></li>
<li data-pid="icelom2"></li>
<li data-pid="icewalk"></li>
<li data-pid="circuitwalk"></li>
</ul>
</div>
<div class="lists lines">
Expand Down
1 change: 1 addition & 0 deletions src/pzpr/variety.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
cave: [1, 0, "バッグ", "Cave", "kurodoko", { alias: "bag" }],
cbanana: [0, 0, "チョコバナナ", "Choco Banana"],
circlesquare: [0, 0, "Circles and Squares", "Circles and Squares"],
circuitwalk: [0, 0, "Circuit Walk", "Circuit Walk", "icewalk"],
context: [0, 0, "Context", "Context"],
crossstitch: [0, 0, "Crossstitch", "Crossstitch"],
cts: [0, 0, "Cross the Streams", "Cross the Streams", "nonogram"],
Expand Down
5 changes: 4 additions & 1 deletion src/res/failcode.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -600,14 +600,15 @@
"lnBranch.forestwalk": "There is a branch line outside of a forest cell.",
"lnBranch": "There is a branch line.",
"lnConsecutive.kaidan": "Two adjacent rectangles don't have a size difference of 1.",
"lnCross.crossstitch": "A loop crosses itself.",
"lnCross": "There is a crossing line.",
"lnCrossExCir.pipelink": "There is a crossing line out of circles.",
"lnCrossExIce": "A line is crossed outside of ice.",
"lnCrossExIce.circuitwalk": "A line is crossed outside of a shaded cell.",
"lnCrossExIce.energywalk": "A line is crossed outside of an energy cell.",
"lnCrossExMk": "There is a crossing outside given crosses.",
"lnCrossOnNum.pipelink": "Lines are crossed on a number.",
"lnCrossPencil.pencils": "A line crosses a pencil.",
"lnCrossSelf": "A loop crosses itself.",
"lnCurveOnCir.pipelink": "A line turns on a circle.",
"lnCurveOnCir.portal": "A line turns on an unmarked portal.",
"lnCurveOnIce": "A line turns on ice.",
Expand Down Expand Up @@ -635,6 +636,7 @@
"lnLenLt.reflect": "The lines passing a triangle are too short.",
"lnMultipleTips.pencils": "A line connects to more than one pencil tip.",
"lnNoBorder.ladders": "A ladder doesn't touch two region borders.",
"lnNoBranch.circuitwalk": "A visited shaded cell doesn't contain a cross.",
"lnNoBranch.energywalk": "A visited energy cell doesn't branch off in all directions.",
"lnNoBranch.forestwalk": "A visited forest cell doesn't contain a T-junction.",
"lnNoBranch.tjunction": "A cell doesn't contain a T-junction.",
Expand Down Expand Up @@ -662,6 +664,7 @@
"lnOverlap.tontti": "A line overlaps a number.",
"lnPassOver.kouchoku": "A segment passes over a clue.",
"lnPlLine": "There are multiple lines.",
"lnPlLoop.circuitwalk": "The various loops don't form a single network.",
"lnPlLoop.crossstitch": "There aren't exactly two loops.",
"lnPlLoop.diamond": "Not all shaded cells and diamonds are connected.",
"lnPlLoop.forestwalk": "There are multiple networks.",
Expand Down
2 changes: 1 addition & 1 deletion src/res/failcode.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,13 @@
"lcTripleNum": "3つ以上の数字がつながっています。",
"lnAdjacent.tontti": "繋がっている線の形が同じです。",
"lnBranch": "分岐している線があります。",
"lnCross.crossstitch": "線が自己交差しています。",
"lnCross": "線が交差しています。",
"lnCrossExCir.pipelink": "○の部分以外で線が交差しています。",
"lnCrossExIce": "氷の部分以外で線が交差しています。",
"lnCrossExMk": "十字以外の場所で線が交差しています。",
"lnCrossOnNum.pipelink": "○の部分で線が交差しています。",
"lnCrossPencil.pencils": "線が鉛筆の軸と交差しています。",
"lnCrossSelf": "線が自己交差しています。",
"lnCurveOnCir.pipelink": "○の部分で線が曲がっています。",
"lnCurveOnIce": "氷の部分で線が曲がっています。",
"lnDeadEnd": "途中で途切れている線があります。",
Expand Down
3 changes: 3 additions & 0 deletions src/variety/crossstitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -888,5 +888,8 @@
return cell.qans === 33;
}).length;
}
},
FailCode: {
lnCross: "lnCrossSelf"
}
});
72 changes: 66 additions & 6 deletions src/variety/icewalk.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"firewalk",
"forestwalk",
"morningwalk",
"energywalk"
"energywalk",
"circuitwalk"
],
{
MouseEvent: {
Expand Down Expand Up @@ -78,7 +79,7 @@
}
}
},
"MouseEvent@morningwalk,energywalk": {
"MouseEvent@morningwalk,energywalk,circuitwalk": {
inputModes: {
edit: ["shade", "number", "clear", "info-line"],
play: ["line", "peke", "info-line"]
Expand Down Expand Up @@ -222,6 +223,9 @@
line: function(val) {
this.board.scanResult = null;
this.board.roommgr.isStale = true;
if (this.board.linesupergraph) {
this.board.linesupergraph.isStale = true;
}
for (var sc = 0; sc <= 1; sc++) {
var cell = this.sidecell[sc];
cell.updateFireQans();
Expand All @@ -239,6 +243,9 @@
},
ques: function(val) {
this.board.roommgr.isStale = true;
if (this.board.linesupergraph) {
this.board.linesupergraph.isStale = true;
}
if (val === 6) {
this.setQnum(-1);
}
Expand Down Expand Up @@ -338,6 +345,11 @@
"Board@firewalk": {
hasdots: 1
},
"Board@circuitwalk": {
addExtraInfo: function() {
this.linesupergraph = this.addInfoList(this.klass.LineSuperGraph);
}
},
"BoardExec@firewalk": {
adjustBoardData: function(key, d) {
if (key & this.TURNFLIP) {
Expand Down Expand Up @@ -391,6 +403,9 @@
"Graphic@energywalk": {
icecolor: "rgb(255, 255, 163)"
},
"Graphic@circuitwalk": {
icecolor: "rgb(118, 165, 175)"
},
"Graphic@firewalk": {
icecolor: "rgb(255, 192, 192)",

Expand Down Expand Up @@ -544,9 +559,26 @@
LineGraph: {
enabled: true
},
"LineGraph@icewalk": {
"LineGraph@icewalk,circuitwalk": {
isLineCross: true
},
"LineSuperGraph:LineGraph@circuitwalk": {
enabled: true,
isLineCross: false,
countprop: "l3cnt",
getComponentRefs: function(obj) {
return obj.lgrph;
},
setComponentRefs: function(obj, component) {
obj.lgrph = component;
},
getObjNodeList: function(nodeobj) {
return nodeobj.lgrphnodes;
},
resetObjNodeList: function(nodeobj) {
nodeobj.lgrphnodes = [];
}
},
"LineGraph@firewalk": {
relation: { "border.line": "link", "cell.qans": "arcs" },
isLineCross: true,
Expand Down Expand Up @@ -720,6 +752,8 @@
"checkForestCell@forestwalk",
"checkEnergyCell@energywalk",
"checkEnergyLoop@energywalk",
"checkCircuitCell@circuitwalk",
"checkSelfIntersect@circuitwalk",

"checkOneLoop",
"checkDoubleTurnOutside@firewalk",
Expand All @@ -741,8 +775,6 @@

checkWalkLength: function(flag, code) {
if (this.board.roommgr.isStale) {
// TODO The room manager will break in certain conditions.
// It is rebuilt here as a workaround.
this.board.roommgr.isStale = false;
this.board.roommgr.rebuild();
}
Expand Down Expand Up @@ -781,7 +813,7 @@
}, "lnIsolate");
}
},
"AnsCheck@icewalk,energywalk#1": {
"AnsCheck@icewalk,energywalk,circuitwalk#1": {
checkCrossLine: function() {
this.checkAllCell(function(cell) {
return cell.lcnt === 4 && !cell.ice();
Expand Down Expand Up @@ -880,6 +912,34 @@
}
}
},
"AnsCheck@circuitwalk": {
checkCircuitCell: function() {
this.checkAllCell(function(cell) {
return cell.lcnt > 1 && cell.ice() && cell.lcnt < 4;
}, "lnNoBranch");
},
checkSelfIntersect: function() {
this.checkAllCell(function(cell) {
return (
cell.lcnt === 4 &&
cell.adjborder.top.path === cell.adjborder.right.path
);
}, "lnCrossSelf");
},
checkOneLoop: function() {
var bd = this.board;
if (bd.linesupergraph.isStale) {
bd.linesupergraph.isStale = false;
bd.linesupergraph.rebuild();
}
var paths = bd.linesupergraph.components;
if (paths.length > 1) {
this.failcode.add("lnPlLoop");
bd.border.setnoerr();
paths[0].setedgeerr(1);
}
}
},
"FailCode@energywalk": {
lnPlLoop: "lnPlLoop.forestwalk"
},
Expand Down
48 changes: 48 additions & 0 deletions test/script/circuitwalk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* circuitwalk.js */

ui.debug.addDebugData("circuitwalk", {
url: "7/7/09cj0160405zzi.i8",
failcheck: [
[
"lnBranch",
"pzprv3/circuitwalk/7/7/5 . . . . . # /. . # . # # . /. # . . # # . /. . . . . . . /. # . . # # . /. . . . . . . /# . - . . . 8 /0 0 0 0 0 0 0 0 /0 0 0 0 0 0 0 0 /0 0 0 0 0 0 0 0 /0 0 0 0 0 0 0 0 /0 0 0 0 0 0 0 0 /0 0 0 0 0 0 0 0 /0 0 1 1 1 1 0 0 /0 0 0 0 0 0 0 /0 0 0 0 0 0 0 /0 0 0 0 0 0 0 /0 0 0 0 0 0 0 /0 0 0 0 0 0 0 /0 0 0 0 0 0 0 /0 1 0 0 1 0 0 /0 0 0 0 0 0 0 /"
],
[
"lnCrossExIce",
"pzprv3/circuitwalk/7/7/5 . . . . . # /. . # . # # . /. # . . # # . /. . . . . . . /. # . . # # . /. . . . . . . /# . - . . . 8 /0 0 0 0 0 0 0 0 /0 0 0 0 0 0 0 0 /0 0 0 1 0 0 0 0 /0 1 1 1 0 0 0 0 /0 0 0 0 0 0 0 0 /0 0 1 0 0 0 0 0 /0 0 1 1 0 0 0 0 /0 0 0 0 0 0 0 /0 0 0 0 0 0 0 /0 0 0 0 0 0 0 /0 0 1 0 0 0 0 /0 0 1 1 0 0 0 /0 0 1 1 0 0 0 /0 1 0 1 0 0 0 /0 0 0 0 0 0 0 /"
],
[
"lnCrossSelf",
"pzprv3/circuitwalk/7/7/5 . . . . . # /. . # . # # . /. # . . # # . /. . . . . . . /. # . . # # . /. . . . . . . /# . - . . . 8 /0 1 1 0 0 0 0 0 /0 1 1 1 0 0 0 0 /0 0 0 0 0 0 0 0 /0 0 0 0 0 0 0 0 /0 0 0 1 0 0 0 0 /0 0 0 0 0 0 0 0 /0 0 0 0 0 0 0 0 /0 0 0 0 0 0 0 /1 0 1 0 0 0 0 /0 0 1 1 0 0 0 /0 0 1 1 0 0 0 /0 0 1 1 0 0 0 /0 0 0 0 0 0 0 /0 0 0 0 0 0 0 /0 0 0 0 0 0 0 /"
],
[
"lnNoBranch",
"pzprv3/circuitwalk/7/7/5 . . . . . # /. . # . # # . /. # . . # # . /. . . . . . . /. # . . # # . /. . . . . . . /# . - . . . 8 /0 1 1 0 0 0 0 0 /0 0 1 1 0 0 0 0 /0 1 1 0 0 0 0 0 /0 1 0 1 0 0 0 0 /0 0 0 0 1 1 1 0 /0 1 0 0 0 0 0 0 /0 0 1 0 1 1 1 0 /0 0 0 0 0 0 0 /1 0 1 0 0 0 0 /1 1 1 1 0 0 0 /0 1 0 1 0 0 0 /1 0 1 0 0 0 0 /1 0 1 1 0 0 1 /0 1 1 1 0 0 1 /0 0 0 0 0 0 0 /"
],
[
"lnPlLoop",
"pzprv3/circuitwalk/7/7/5 . . . . . # /. . # . # # . /. # . . # # . /. . . . . . . /. # . . # # . /. . . . . . . /# . - . . . 8 /0 1 1 0 0 0 0 0 /0 0 1 1 0 0 0 0 /0 1 1 0 0 0 0 0 /0 0 1 0 0 0 0 0 /0 0 0 1 0 0 0 0 /0 0 1 0 1 1 1 0 /0 0 1 0 1 1 1 0 /0 0 0 0 0 0 0 /1 0 1 0 0 0 0 /1 1 1 1 0 0 0 /0 1 0 1 0 0 0 /0 0 1 1 0 0 0 /0 0 0 0 0 0 0 /0 1 1 1 0 0 1 /0 0 0 0 0 0 0 /"
],
[
"bkSizeLt",
"pzprv3/circuitwalk/7/7/5 . . . . . # /. . # . # # . /. # . . # # . /. . . . . . . /. # . . # # . /. . . . . . . /# . - . . . 8 /0 0 0 0 0 1 0 0 /0 0 0 0 0 0 0 0 /0 0 0 0 1 1 1 0 /0 0 0 0 0 0 0 0 /0 0 0 0 1 1 1 0 /0 0 0 0 0 0 1 0 /0 0 0 0 0 1 1 0 /0 0 0 0 0 0 0 /0 0 0 0 1 1 0 /0 0 0 0 1 1 0 /0 0 0 1 1 1 1 /0 0 0 1 1 1 1 /0 0 0 0 1 1 0 /0 0 0 0 1 0 1 /0 0 0 0 0 0 0 /"
],
[
"bkSizeGt",
"pzprv3/circuitwalk/7/7/5 . . . . . # /. . # . # # . /. # . . # # . /. . . . . . . /. # . . # # . /. . . . . . . /# . - . . . 8 /0 1 1 1 0 0 0 0 /0 0 0 0 0 0 0 0 /0 1 1 1 0 0 0 0 /0 0 0 0 0 0 0 0 /0 0 0 0 0 0 0 0 /0 0 0 0 1 1 1 0 /0 0 0 0 1 1 1 0 /0 0 0 0 0 0 0 /1 0 0 1 0 0 0 /1 0 0 1 0 0 0 /0 0 0 0 0 0 0 /0 0 0 0 0 0 0 /0 0 0 0 0 0 0 /0 0 0 1 0 0 1 /0 0 0 0 0 0 0 /"
],
[
"lnDeadEnd",
"pzprv3/circuitwalk/7/7/5 . . . . . # /. . # . # # . /. # . . # # . /. . . . . . . /. # . . # # . /. . . . . . . /# . - . . . 8 /0 1 1 0 0 1 0 0 /0 0 1 1 1 1 1 0 /0 1 1 0 1 1 1 0 /0 0 0 1 0 0 0 0 /0 0 0 0 1 1 1 0 /0 0 0 0 0 1 0 0 /0 0 1 0 1 1 1 0 /0 0 0 0 0 0 0 /1 0 1 0 1 1 0 /1 1 1 0 1 1 1 /0 1 0 1 1 1 0 /0 0 1 0 1 1 0 /0 0 1 1 1 1 1 /0 0 1 1 0 0 1 /0 0 0 0 0 0 0 /"
],
[
"lnIsolate",
"pzprv3/circuitwalk/7/7/5 . . . . . # /. . # . # # . /. # . . # # . /. . . . . . . /. # . . # # . /. . . . . . . /# . - . . . 8 /0 1 1 0 0 1 0 0 /0 0 1 1 1 1 1 0 /0 1 1 0 1 1 1 0 /0 1 0 1 0 0 0 0 /0 0 0 0 1 1 1 0 /0 1 1 0 0 1 0 0 /0 0 0 0 1 1 1 0 /0 0 0 0 0 0 0 /1 0 1 0 1 1 0 /1 1 1 0 1 1 1 /0 1 0 1 1 1 0 /1 0 1 0 1 1 0 /1 0 1 1 1 1 1 /0 0 0 1 0 0 1 /0 0 0 0 0 0 0 /"
],
[
null,
"pzprv3/circuitwalk/7/7/5 . . . . . # /. . # . # # . /. # . . # # . /. . . . . . . /. # . . # # . /. . . . . . . /# . - . . . 8 /0 1 1 0 0 1 0 0 /0 0 1 1 1 1 1 0 /0 1 1 0 1 1 1 0 /0 1 0 1 0 0 0 0 /0 0 0 0 1 1 1 0 /0 1 0 0 0 1 0 0 /0 0 1 0 1 1 1 0 /0 0 0 0 0 0 0 /1 0 1 0 1 1 0 /1 1 1 0 1 1 1 /0 1 0 1 1 1 0 /1 0 1 0 1 1 0 /1 0 1 1 1 1 1 /0 1 1 1 0 0 1 /0 0 0 0 0 0 0 /"
]
],
inputs: []
});