Skip to content

Commit 76e2b92

Browse files
authored
Add Heavy Dots
1 parent 8c3f1b9 commit 76e2b92

9 files changed

Lines changed: 431 additions & 19 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?heavydots" target="_parent">Heavy Dots</a></li>
3637
<li><a href="/p?bhaibahan" target="_parent">Bhai Bahan</a></li>
3738
<li><a href="/p?oasis" target="_parent">Oasis</a></li>
3839
<li><a href="/p?circuitwalk" target="_parent">Circuit Walk</a></li>
3940
<li><a href="/p?cornerch" target="_parent">Corner Chain 隅角チェーン</a></li>
4041
<li><a href="/p?sendai" target="_parent">Sendai-Miyagi 宮城県仙台市</a></li>
4142
<li><a href="/p?keywest" target="_parent">Key West キーウエスト</a></li>
42-
<li><a href="/p?morningwalk" target="_parent">Morning Walk</a></li>
4343
</ul>
4444
</main>
4545
</body>

src-ui/js/ui/KeyPopup.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ ui.keypopup = {
245245
cornerch: [10, 0],
246246
keywest: [4, 4],
247247
oasis: [10, 0],
248-
bhaibahan: [10, 0]
248+
bhaibahan: [10, 0],
249+
heavydots: [10, 0]
249250
},
250251

251252
//---------------------------------------------------------------------------

src-ui/list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
302302
<li data-pid="balloon"></li>
303303
<li data-pid="narrow"></li>
304304
<li data-pid="sendai"></li>
305+
<li data-pid="heavydots"></li>
305306
</ul>
306307
</div>
307308
<div class="lists divides">

src/pzpr/variety.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
"",
194194
{ pzprurl: "hashi", kanpen: "hashi", alias: "bridges" }
195195
],
196+
heavydots: [0, 0, "Heavy Dots", "Heavy Dots"],
196197
hebi: [1, 0, "へびいちご", "Hebi-Ichigo", "", { old: "snakes" }],
197198
herugolf: [0, 0, "ヘルゴルフ", "Herugolf"],
198199
heteromino: [0, 0, "ヘテロミノ", "Heteromino", "nawabari"],

src/res/failcode.en.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@
6262
"bdCross": "There is a crossing border line.",
6363
"bdCrossBP.kramma": "There is a crossing line on the point.",
6464
"bdCrossExBP.bdblock": "Lines are crossed out of the point.",
65+
"bdCrossExBP.heavydots": "A black dot has more than 3 lines.",
66+
"bdCrossNearBP.heavydots": "A vertex adjacent to a dot has more than 2 lines.",
67+
"bdCrossUnder.heavydots": "A black dot has less than 3 lines.",
68+
"bdCrossUnderWhite.heavydots": "A white dot has less than 4 lines.",
6569
"bdCurveExBP.kramma": "A line curves out of the points.",
6670
"bdDeadEnd": "There is a dead-end line.",
6771
"bdDoorsGt.oneroom": "Two rooms have more than one door between them.",
@@ -89,6 +93,7 @@
8993
"bdwMismatch.bdwalk": "The line goes through different numbers without switching floors.",
9094
"bdwSkipElevator.bdwalk": "The line doesn't change floors at an elevator.",
9195
"bdwTopFloor.bdwalk": "The line goes above the top floor.",
96+
"bk2x2": "There is a 2x2 block of cells belonging to the same region.",
9297
"bkArafEqual.araf": "An area is equal to a number.",
9398
"bkArafTooBig.araf": "An area is larger than both numbers.",
9499
"bkArafTooSmall.araf": "An area is smaller than both numbers.",

src/variety-common/Encode.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -750,41 +750,44 @@ pzpr.classmgr.makeCommon({
750750
// enc.decodeCircle() 白丸・黒丸をデコードする
751751
// enc.encodeCircle() 白丸・黒丸をエンコードする
752752
//---------------------------------------------------------------------------
753-
genericDecodeThree: function(set_func) {
754-
var bd = this.board;
753+
genericDecodeTriple: function(length, set_func) {
755754
var bstr = this.outbstr,
756755
c = 0,
757756
tri = [9, 3, 1];
758-
var pos = bstr
759-
? Math.min(((bd.cols * bd.rows + 2) / 3) | 0, bstr.length)
760-
: 0;
757+
var pos = bstr ? Math.min(((length + 2) / 3) | 0, bstr.length) : 0;
761758
for (var i = 0; i < pos; i++) {
762759
var ca = parseInt(bstr.charAt(i), 27);
763760
for (var w = 0; w < 3; w++) {
764-
if (!!bd.cell[c]) {
765-
var val = ((ca / tri[w]) | 0) % 3;
766-
if (val > 0) {
767-
set_func(bd.cell[c], val);
768-
}
769-
c++;
761+
var val = ((ca / tri[w]) | 0) % 3;
762+
if (val > 0) {
763+
set_func(c, val);
770764
}
765+
c++;
771766
}
772767
}
773768
this.outbstr = bstr.substr(pos);
774769
},
770+
genericDecodeThree: function(set_func) {
771+
var bd = this.board;
772+
this.genericDecodeTriple(bd.cell.length, function(c, val) {
773+
var cell = bd.cell[c];
774+
if (cell) {
775+
set_func(cell, val);
776+
}
777+
});
778+
},
775779
decodeCircle: function() {
776780
this.genericDecodeThree(function(cell, val) {
777781
cell.qnum = val;
778782
});
779783
},
780-
genericEncodeThree: function(get_func) {
781-
var bd = this.board;
784+
genericEncodeTriple: function(length, get_func) {
782785
var cm = "",
783786
num = 0,
784787
pass = 0,
785788
tri = [9, 3, 1];
786-
for (var c = 0; c < bd.cell.length; c++) {
787-
pass += get_func(bd.cell[c]) * tri[num];
789+
for (var c = 0; c < length; c++) {
790+
pass += get_func(c) * tri[num];
788791
num++;
789792
if (num === 3) {
790793
cm += pass.toString(27);
@@ -798,6 +801,12 @@ pzpr.classmgr.makeCommon({
798801

799802
this.outbstr += cm;
800803
},
804+
genericEncodeThree: function(get_func) {
805+
var bd = this.board;
806+
this.genericEncodeTriple(bd.cell.length, function(c) {
807+
return get_func(bd.cell[c]);
808+
});
809+
},
801810
encodeCircle: function() {
802811
this.genericEncodeThree(function(cell) {
803812
return Math.max(0, cell.qnum);

src/variety-common/MouseInput.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ pzpr.classmgr.makeCommon({
599599
}
600600
cross.draw();
601601
},
602-
inputcrossMark: function() {
602+
inputcrossMark: function(value) {
603603
var pos = this.getpos(0.24);
604604
if (!pos.oncross()) {
605605
return;
@@ -619,9 +619,12 @@ pzpr.classmgr.makeCommon({
619619
if (cross.isnull) {
620620
return;
621621
}
622+
if (value === undefined) {
623+
value = 1;
624+
}
622625

623626
this.puzzle.opemgr.disCombine = true;
624-
cross.setQnum(cross.qnum === 1 ? -1 : 1);
627+
cross.setQnum(cross.qnum === value ? -1 : value);
625628
this.puzzle.opemgr.disCombine = false;
626629

627630
cross.draw();

0 commit comments

Comments
 (0)