Skip to content

Commit 3b7f1d1

Browse files
committed
Failchecks
1 parent 5eabfce commit 3b7f1d1

3 files changed

Lines changed: 27 additions & 11 deletions

File tree

src/res/failcode.en.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,7 @@
434434
"crConnSlNe.gokigen": "A number is not equal to count of lines that is connected to it.",
435435
"crNoSegment.tajmahal": "A clue is not inside a square.",
436436
"crShade0": "A number 0 is overlapping a shaded cell.",
437-
"crShade1": "A number 1 isn't overlapping exactly one shaded cell.",
438-
"crShadeDistNe.landmeasure": "A number isn't equal to the distance from this and that",
437+
"crShadeDistNe.landmeasure": "A number isn't equal to the length of the path covering all adjacent cells.",
439438
"crShadeInfinite.landmeasure": "An infinity clue doesn't overlap 2 disconnected shaded cells.",
440439
"crShadeGt.creek": "The number of shaded cells overlapping a number is too high.",
441440
"crShadeLt.creek": "The number of shaded cells overlapping a number is too low.",

src/variety/landmeasure.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@
214214
"checkZeroes",
215215
"checkAllNumbers",
216216
"checkInfinites",
217-
"checkOnes",
218217
"doneShadingDecided"
219218
],
220219

@@ -250,12 +249,6 @@
250249
}, "crShade0");
251250
},
252251

253-
checkOnes: function() {
254-
this.checkQnumCross(function(num, shaded) {
255-
return num === 1 && shaded.length !== 1;
256-
}, "crShade1");
257-
},
258-
259252
checkInfinites: function() {
260253
this.checkQnumCross(function(num, shaded) {
261254
if (num !== -2) {
@@ -271,8 +264,8 @@
271264
if (num < 2) {
272265
return false;
273266
}
274-
if (num === 3) {
275-
return shaded.length !== 3;
267+
if (num === 1 || num === 3) {
268+
return shaded.length !== num;
276269
}
277270
if (shaded.length !== 2 || shaded[0].sblk !== shaded[1].sblk) {
278271
return true;

test/script/landmeasure.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,30 @@
33
ui.debug.addDebugData("landmeasure", {
44
url: "6/6/n7h.g2u9i3o0h2h",
55
failcheck: [
6+
[
7+
"brNoShade",
8+
"pzprv3/landmeasure/6/6/. . . . . . . /. 7 . . - . 2 /. . . . . . . /. . . . . . . /. 9 . . . 3 . /. . . . . . . /. 0 . . 2 . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /"
9+
],
10+
[
11+
"cs2x2",
12+
"pzprv3/landmeasure/6/6/. . . . . . . /. 7 . . - . 2 /. . . . . . . /. . . . . . . /. 9 . . . 3 . /. . . . . . . /. 0 . . 2 . . /. # # # . # /# . # . # # /# # # # . . /# . . # . # /. # # # # # /. . . # # . /"
13+
],
14+
[
15+
"csLoop",
16+
"pzprv3/landmeasure/6/6/. . . . . . . /. 7 . . - . 2 /. . . . . . . /. . . . . . . /. 9 . . . 3 . /. . . . . . . /. 0 . . 2 . . /. . . . . . /. . . . . . /# # # # . . /# . . # # # /. # # # . # /. . . # # # /"
17+
],
18+
[
19+
"crShade0",
20+
"pzprv3/landmeasure/6/6/. . . . . . . /. 7 . . - . 2 /. . . . . . . /. . . . . . . /. 9 . . . 3 . /. . . . . . . /. 0 . . 2 . . /. . . . . . /. . . . . . /. . . . . . /. # # # # # /# . . # . # /# # # # # . /"
21+
],
22+
[
23+
"crShadeDistNe",
24+
"pzprv3/landmeasure/6/6/. . . . . . . /. 7 . . - . 2 /. . . . . . . /. . . . . . . /. 9 . . . 3 . /. . . . . . . /. 0 . . 2 . . /. # # # . # /# . # . # # /# # # . . . /# . # . . # /. # # . # # /. . . # # . /"
25+
],
26+
[
27+
"crShadeInfinite",
28+
"pzprv3/landmeasure/6/6/. . . . . . . /. 7 . . - . 2 /. . . . . . . /. . . . . . . /. 9 . . . 3 . /. . . . . . . /. 0 . . 2 . . /. # # # . # /# . # . # # /# # # # . # /# . . # # # /. # # # . # /. . . # # . /"
29+
],
630
[
731
null,
832
"pzprv3/landmeasure/6/6/. . . . . . . /. 7 . . - . 2 /. . . . . . . /. . . . . . . /. 9 . . . 3 . /. . . . . . . /. 0 . . 2 . . /. # # # . # /# . # . # # /# # # # . . /# . . # # # /. # # # . # /. . . # # . /"

0 commit comments

Comments
 (0)