Skip to content

Commit c1fc667

Browse files
committed
Add Slovak Sums
1 parent f4b0bdb commit c1fc667

11 files changed

Lines changed: 739 additions & 11 deletions

File tree

src-ui/js/ui/KeyPopup.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ ui.keypopup = {
262262
topo: [10, 10],
263263
soulmates: [10, 10],
264264
landmeasure: [10, 0],
265-
elasticlink: [10, 0]
265+
elasticlink: [10, 0],
266+
slovak: [136, 10]
266267
},
267268

268269
//---------------------------------------------------------------------------
@@ -425,6 +426,8 @@ ui.keypopup = {
425426
this.generate_narrowfence(mode);
426427
} else if (type === 135) {
427428
this.generate_ubahn(mode);
429+
} else if (type === 136) {
430+
this.generate_slovak(mode);
428431
} else if (type === 5339) {
429432
this.generate_swslither();
430433
}
@@ -789,6 +792,16 @@ ui.keypopup = {
789792
5
790793
);
791794
},
795+
generate_slovak: function() {
796+
var itemlist = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", " "];
797+
itemlist.push(["-", "?"]);
798+
itemlist.push(["q", "⠐"]);
799+
itemlist.push(["w", "⠒"]);
800+
itemlist.push(["e", "…"]);
801+
itemlist.push(["r", "⸬"]);
802+
803+
this.generate_main(itemlist, 4);
804+
},
792805
generate_interbd: function() {
793806
this.generate_main(
794807
[

src-ui/list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
363363
<li data-pid="simplegako"></li>
364364
<li data-pid="japanesesums"></li>
365365
<li data-pid="soulmates"></li>
366+
<li data-pid="slovak"></li>
366367
</ul>
367368
</div>
368369
<div class="lists numbers">

src/puzzle/Graphic.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,7 @@
456456
// pc.resetRange() rangeオブジェクトを初期化する
457457
//---------------------------------------------------------------------------
458458
prepaint: function() {
459-
var hasIndicator =
460-
this.pid === "starbattle" || this.pid === "isowatari";
459+
var hasIndicator = this.puzzle.cursor.hasIndicator;
461460
if (this.suspended || !this.context) {
462461
return;
463462
}

src/puzzle/KeyInput.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,17 +324,16 @@ pzpr.classmgr.makeCommon({
324324
},
325325
moveTC: function(ca, mv) {
326326
var cursor = this.cursor,
327+
editmode = this.puzzle.editmode,
327328
pos0 = cursor.getaddr(),
328329
flag = true,
329330
dir = cursor.NDIR;
330331

331-
var hasIndicator = this.pid === "easyasabc" || this.pid === "isowatari";
332-
333332
switch (ca) {
334333
case "up":
335334
if (
336-
(hasIndicator && cursor.by === cursor.miny) ||
337-
cursor.by - mv >= cursor.miny
335+
cursor.by - mv >= cursor.miny ||
336+
(editmode && cursor.hasIndicator && cursor.by === cursor.miny)
338337
) {
339338
dir = cursor.UP;
340339
}
@@ -622,12 +621,11 @@ pzpr.classmgr.makeCommon({
622621
// tc.setaddr() ターゲットの位置をAddressクラス等のオブジェクトで設定する
623622
//---------------------------------------------------------------------------
624623
setaddr: function(pos) {
625-
var hasIndicator = this.pid === "easyasabc" || this.pid === "isowatari";
626624
/* Address, Cellなどのオブジェクトいずれを入力しても良い */
627625
if (
628626
pos.bx < this.minx ||
629627
this.maxx < pos.bx ||
630-
pos.by < this.miny - (hasIndicator ? 2 : 0) ||
628+
pos.by < this.miny - (this.hasIndicator ? 2 : 0) ||
631629
this.maxy < pos.by
632630
) {
633631
return;

src/pzpr/variety.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@
432432
"",
433433
{ kanpen: "slitherlink" }
434434
],
435+
slovak: [0, 0, "Slovak Sums", "Slovak Sums"],
435436
smullyan: [0, 0, "Smullyanic Dynasty", "Smullyanic Dynasty", "context"],
436437
snake: [0, 0, "Snake", "Snake"],
437438
snakeegg: [0, 0, "Snake Egg", "Snake Egg"],

src/res/failcode.en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,7 @@
768768
"nmBranch.snakepit": "A snake branches off.",
769769
"nmCircleNe.brownies": "A number is not equal to the amount of circles in the surrounding cells.",
770770
"nmCircleNe.crossstitch": "A circled number is not equal to the amount of corners used by a loop.",
771+
"nmCircleNe.slovak": "The amount of circles is not equal to the amount of numbers in the surrounding cells.",
771772
"nmConnBarWrong": "The number of lines connected to a shaded cell is wrong.",
772773
"nmConnDiff.arukone": "Different alphabets are connected.",
773774
"nmConnDiff.kouchoku": "Different letters are connected directly.",
@@ -831,6 +832,7 @@
831832
"nmMissing.lohkous": "There is no segment of the given length in the room.",
832833
"nmMissRow.alter": "A row or column has less than two symbols.",
833834
"nmMissRow.easyasabc": "There are missing letters in a row or column.",
835+
"nmMissRow.slovak": "There are missing numbers in a row or column.",
834836
"nmMixed.aquapelago": "A group contains different numbers.",
835837
"nmMoveNe.tren": "A block cannot move in the correct number of spaces.",
836838
"nmNoLine.amibo": "No bar connects to a white circle.",
@@ -932,7 +934,7 @@
932934
"nmVertexNe.vslither": "The number is not equal to the number of visited vertices around it.",
933935
"nonCirclePromontory.kurodoko": "A dead end has no circle.",
934936
"nqAroundDup.kakuru": "There are same numbers around the pre-numbered cell.",
935-
"nqAroundSumNe.kakuru": "A sum of numbers around the pre-numbered cell is incorrect.",
937+
"nqAroundSumNe": "A sum of numbers around the pre-numbered cell is incorrect.",
936938
"numNoLine": "A number has no line.",
937939
"objShaded.nurimaze": "An object is shaded.",
938940
"objShaded.tilecity": "A number is shaded.",

src/res/failcode.ja.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@
586586
"nmUnpass.icebarn": "通過していない数字があります。",
587587
"nonCirclePromontory.kurodoko": "丸のないマスが岬になっています。",
588588
"nqAroundDup.kakuru": "初めから出ている数字の周りに同じ数字が入っています。",
589-
"nqAroundSumNe.kakuru": "初めから出ている数字の周りに入る数の合計が正しくありません。",
589+
"nqAroundSumNe": "初めから出ている数字の周りに入る数の合計が正しくありません。",
590590
"numNoLine": "線の通っていない数字があります。",
591591
"objShaded.nurimaze": "オブジェクトが黒マスになっています。",
592592
"pairedLetterNe.kinkonkan": "光が同じ文字の場所へ到達しません。",

src/variety/easyasabc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@
108108
},
109109

110110
TargetCursor: {
111+
hasIndicator: true,
112+
111113
draw: function() {
112114
if (this.by >= this.board.minby) {
113115
this.common.draw.call(this);

src/variety/isowatari.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@
130130
},
131131

132132
TargetCursor: {
133+
hasIndicator: true,
134+
133135
draw: function() {
134136
if (this.by >= this.board.minby) {
135137
this.common.draw.call(this);

0 commit comments

Comments
 (0)