Skip to content

Commit 37b88ba

Browse files
committed
Add Vertigo
1 parent d2509dd commit 37b88ba

8 files changed

Lines changed: 133 additions & 7 deletions

File tree

src-ui/changes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
<main>
3434
<div style="margin-bottom: 5px;"><b>Latest types</b> (<em><a href="/list.html" target="_parent">all types</a></em>)</div>
3535
<ul>
36+
<li><a href="/p?vertigo" target="_parent">Vertigo</a></li>
3637
<li><a href="/p?mrokmrno" target="_parent">Mr. OK and Mr. NO</a></li>
3738
<li><a href="/p?slovak" target="_parent">Slovak Sums</a></li>
3839
<li><a href="/p?anymino" target="_parent">Anymino</a></li>
3940
<li><a href="/p?elasticlink" target="_parent">Elastic Link</a></li>
4041
<li><a href="/p?landmeasure" target="_parent">Land Measurement</a></li>
4142
<li><a href="/p?trizone" target="_parent">Trizone サントイッチ</a></li>
42-
<li><a href="/p?ubahn" target="_parent">U-Bahn</a></li>
4343
</ul>
4444
</main>
4545
</body>

src-ui/img/vertigo.png

130 Bytes
Loading

src-ui/js/ui/Misc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ function toBGimage(pid) {
253253
"tslither",
254254
"turnaround",
255255
"ubahn",
256+
"vertigo",
256257
"voxas",
257258
"vslither",
258259
"wafusuma",

src-ui/list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
224224
<li data-pid="turnrun"></li>
225225
<li data-pid="orbital"></li>
226226
<li data-pid="circuitwalk"></li>
227+
<li data-pid="vertigo"></li>
227228
</ul>
228229
</div>
229230
<div class="lists lines">

src/pzpr/variety.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@
496496
usotatami: [0, 0, "ウソタタミ", "Uso-tatami", "fillmat"],
497497
usoone: [0, 0, "ウソワン", "Uso-one"],
498498
uturns: [0, 0, "U-Turns", "U-Turns", "kusabi"],
499+
vertigo: [0, 0, "Vertigo", "Vertigo", "simpleloop"],
499500
view: [1, 0, "ヴィウ", "View", "sukoro"],
500501
voxas: [0, 0, "Voxas", "Voxas"],
501502
vslither: [0, 0, "Vertex Slitherlink", "Vertex Slitherlink"],

src/res/failcode.en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@
694694
"lnNotRect.nagenawa": "There is a non-rectangle loop.",
695695
"lnNotSq.tajmahal": "A segment doesn't form a square.",
696696
"lcNotUTurns.uturns": "A line does not turn twice in the same direction between circles.",
697+
"lcNotUTurns.vertigo": "A line turns in the wrong direction.",
697698
"lnOnCenter.midloop": "A circle is not the center point of a line.",
698699
"lnOnClue.tajmahal": "A corner is on top of a clue.",
699700
"lnOnCorner.tajmahal": "A segment overlaps a corner.",

src/variety/simpleloop.js

Lines changed: 82 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
} else {
55
pzpr.classmgr.makeCustom(pidlist, classbase);
66
}
7-
})(["simpleloop"], {
7+
})(["simpleloop", "vertigo"], {
88
MouseEvent: {
99
inputModes: {
1010
edit: ["clear", "info-line", "empty"],
@@ -16,9 +16,44 @@
1616

1717
autoplay_func: "line"
1818
},
19+
"MouseEvent@vertigo": {
20+
inputModes: {
21+
edit: ["clear", "info-line", "empty"],
22+
play: ["line", "diraux", "peke", "clear", "info-line"]
23+
},
24+
mouseinputAutoPlay: function() {
25+
if (this.btn === "right") {
26+
if (this.mousestart) {
27+
this.inputdiraux_mousedown();
28+
} else if (this.inputData === 2 || this.inputData === 3) {
29+
this.inputpeke();
30+
} else if (this.mousemove) {
31+
this.inputdiraux_mousemove();
32+
}
33+
} else {
34+
if (this.mousestart || this.mousemove) {
35+
this.inputLine();
36+
} else if (this.mouseend && this.notInputted()) {
37+
this.clickdiraux();
38+
}
39+
}
40+
},
41+
mouseinput_other: function() {
42+
if (this.inputMode === "diraux") {
43+
if (this.mousestart || this.mousemove) {
44+
this.inputdiraux_mousemove();
45+
} else if (this.mouseend && this.notInputted()) {
46+
this.clickdiraux();
47+
}
48+
}
49+
}
50+
},
1951
Cell: {
2052
noLP: function(dir) {
2153
return this.isEmpty();
54+
},
55+
isLineShapeEndpoint: function() {
56+
return this.isLineCurve();
2257
}
2358
},
2459
Border: {
@@ -30,12 +65,13 @@
3065
LineGraph: {
3166
enabled: true
3267
},
68+
"LineGraph@vertigo": {
69+
isLineCross: true
70+
},
3371

3472
Graphic: {
3573
irowake: true,
3674

37-
numbercolor_func: "qnum",
38-
3975
gridcolor_type: "SLIGHT",
4076

4177
paint: function() {
@@ -46,6 +82,9 @@
4682

4783
this.drawLines();
4884
this.drawPekes();
85+
if (this.pid === "vertigo") {
86+
this.drawBorderAuxDir();
87+
}
4988

5089
this.drawChassis();
5190
},
@@ -85,14 +124,51 @@
85124
});
86125
}
87126
},
127+
"FileIO@vertigo": {
128+
decodeData: function() {
129+
this.decodeEmpty();
130+
this.decodeBorderArrowAns();
131+
},
132+
encodeData: function() {
133+
this.encodeEmpty();
134+
this.encodeBorderArrowAns();
135+
}
136+
},
88137

89138
AnsCheck: {
90139
checklist: [
91140
"checkBranchLine",
92-
"checkCrossLine",
141+
"checkCrossLine@!vertigo",
142+
"checkSameTurns@vertigo",
93143
"checkDeadendLine+",
94144
"checkOneLoop",
95-
"checkNoLine"
96-
]
145+
"checkNoLine+"
146+
],
147+
148+
checkSameTurns: function() {
149+
var checkOnly = this.checkOnly;
150+
this.checkLineShape(function(path) {
151+
if (path.cells[0].isnull || path.cells[1].isnull) {
152+
return false;
153+
}
154+
155+
var dirs1 = path.cells[0].adjborder;
156+
var dirs2 = path.cells[1].adjborder;
157+
158+
for (var dir in dirs1) {
159+
if (!dirs1[dir].isLine() && !dirs2[dir].isLine()) {
160+
return false;
161+
}
162+
}
163+
164+
if (!checkOnly) {
165+
for (var dir in dirs1) {
166+
dirs1[dir].seterr(1);
167+
dirs2[dir].seterr(1);
168+
}
169+
}
170+
return true;
171+
}, "lcNotUTurns");
172+
}
97173
}
98174
});

test/script/vertigo.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
ui.debug.addDebugData("vertigo", {
2+
url: "5/5/o080p",
3+
failcheck: [
4+
[
5+
"lnBranch",
6+
"pzprv3/vertigo/5/5/* * . . . /. . . . . /. * . . . /. . . . . /* * . . * /0 0 1 1 /1 1 0 0 /0 0 1 0 /1 1 0 1 /0 0 1 0 /0 0 1 1 1 /1 0 1 1 1 /1 0 0 0 1 /0 0 1 1 0 /"
7+
],
8+
[
9+
"lcNotUTurns",
10+
"pzprv3/vertigo/5/5/* * . . . /. . . . . /. * . . . /. . . . . /* * . . * /0 0 1 1 /1 1 1 0 /0 0 1 0 /1 1 0 1 /0 0 1 0 /0 0 1 0 1 /1 0 1 1 1 /1 0 0 0 1 /0 0 1 1 0 /"
11+
],
12+
[
13+
"lnDeadEnd",
14+
"pzprv3/vertigo/5/5/* * . . . /. . . . . /. * . . . /. . . . . /* * . . * /0 0 1 1 /1 1 1 0 /0 0 0 0 /1 1 1 1 /0 0 1 0 /0 0 1 0 1 /1 0 1 0 1 /1 0 1 1 1 /0 0 1 1 0 /"
15+
],
16+
[
17+
"lnPlLoop",
18+
"pzprv3/vertigo/5/5/* * . . . /. . . . . /. * . . . /. . . . . /* * . . * /0 0 1 0 /1 1 1 1 /0 0 0 0 /1 1 1 1 /0 0 1 0 /0 0 1 1 0 /1 0 1 1 1 /1 0 1 1 1 /0 0 1 1 0 /"
19+
],
20+
[
21+
"ceNoLine",
22+
"pzprv3/vertigo/5/5/* * . . . /. . . . . /. * . . . /. . . . . /* * . . * /0 0 1 1 /1 1 1 0 /0 0 1 0 /1 1 1 1 /0 0 0 0 /0 0 1 0 1 /1 0 1 1 1 /1 0 0 0 1 /0 0 0 0 0 /"
23+
],
24+
[
25+
null,
26+
"pzprv3/vertigo/5/5/* * . . . /. . . . . /. * . . . /. . . . . /* * . . * /0 0 1r 1 /1r 1 1 0 /0 0 0 0 /1 1l 1 1 /0 0 1l 0 /0 0 1 0 1 /1 0 1u 1 1d /1u 0 1 1d 1 /0 0 1 1 0 /"
27+
]
28+
],
29+
inputs: [
30+
{
31+
input: [
32+
"newboard,3,3",
33+
"editmode",
34+
"mouse,left,1,1",
35+
"playmode",
36+
"mouse,left,3,1,3,5",
37+
"mouse,right,3,1,5,1,5,3",
38+
"mouse,right,1,4",
39+
"playmode,diraux",
40+
"mouse,left,5,5,3,5"
41+
],
42+
result:
43+
"pzprv3/vertigo/3/3/* . . /. . . /. . . /0 r /0 0 /0 l /0 1 d /-1 1 0 /"
44+
}
45+
]
46+
});

0 commit comments

Comments
 (0)