Skip to content
Merged
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
3 changes: 3 additions & 0 deletions src-ui/js/ui/MenuConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@
case "trizone":
idname = "trizone_ghost";
break;
case "scrabble":
idname = "scrabble_given";
break;
case "slither":
case "tslither":
case "swslither":
Expand Down
6 changes: 6 additions & 0 deletions src-ui/p.html
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,12 @@ <h2 id="title2">読み込み中です...</h2>
<span>__lapaz_liar__</span>
</label>
</div>
<div class="config" data-config="scrabble_given">
<label>
<input type="checkbox">
<span>__scrabble_given__</span>
</label>
</div>
<div class="config" data-config="slither_full">
<label>
<input type="checkbox">
Expand Down
1 change: 1 addition & 0 deletions src-ui/res/p.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
"fillomino_tri": "Maximum block size is 3",
"trizone_ghost": "Regions can have no clues",
"lapaz_liar": "Liar (clues can be erased by shading)",
"scrabble_given": "All letters of a certain type are given",
"slither_full": "All points must be visited",
"loop_full": "All cells must be visited",
"variant": "This puzzle uses variant rules",
Expand Down
4 changes: 4 additions & 0 deletions src/puzzle/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@
variant: true,
volatile: true
}); /* Clues may be erased by shading over them */
this.add("scrabble_given", false, {
variant: true,
volatile: true
}); /* All letters of a certain type are given */
this.add("slither_full", false, {
variant: true,
volatile: true
Expand Down
1 change: 1 addition & 0 deletions src/res/failcode.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@
"nmNotConseq.kouchoku": "Equal letters are not connected directly.",
"nmNotConseq.trainstations": "A number doesn't connect to the next consecutive number.",
"nmNotConseqFull.trainstations": "A number doesn't connect to the next consecutive number.",
"nmNotGiven.scrabble": "There are too many instances of the given letter.",
"nmNotLink.kazunori": "A number doesn't link to other cells in the room.",
"nmNotSeq.numrope": "The numbers on a line are not consecutive.",
"nmNumberEq.oyakodori": "Two identical birds are in the same nest.",
Expand Down
24 changes: 23 additions & 1 deletion src/variety/scrabble.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,21 +362,25 @@
decodePzpr: function(type) {
this.decodeNumber16();
this.decodePieceBank();
this.puzzle.setConfig("scrabble_given", this.checkpflag("g"));
},
encodePzpr: function(type) {
this.outpflag = this.puzzle.getConfig("scrabble_given") ? "g" : null;
this.encodeNumber16();
this.encodePieceBank();
}
},

FileIO: {
decodeData: function() {
this.decodeConfigFlag("g", "scrabble_given");
this.decodeCellQnum();
this.decodeCellAnumsub();
this.decodePieceBank();
this.decodePieceBankQcmp();
},
encodeData: function() {
this.encodeConfigFlag("g", "scrabble_given");
this.encodeCellQnum();
this.encodeCellAnumsub();
this.encodePieceBank();
Expand All @@ -388,8 +392,26 @@
checklist: [
"checkBankPiecesAvailable",
"checkBankPiecesInvalid",
"checkGivenLetters",
"checkConnectNumber",
"checkBankPiecesUsed"
]
],

checkGivenLetters: function() {
if (!this.puzzle.getConfig("scrabble_given")) {
return;
}

var letters = new Set();
this.board.cell.each(function(cell) {
if (cell.qnum >= 0) {
letters.add(cell.qnum);
}
});

this.checkAllCell(function(cell) {
return cell.qnum === -1 && cell.anum >= 0 && letters.has(cell.anum);
}, "nmNotGiven");
}
}
});
10 changes: 10 additions & 0 deletions test/script/scrabble.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ ui.debug.addDebugData("scrabble", {
"bankLt",
"pzprv3/scrabble/8/6/. . . . . . /. . . . . . /19 . . . . . /. . . 6 . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /. . . 19 . . /. . . 21 . . /. . . 18 . . /8 . . . . . /1 . 23 1 12 12 /16 . . 3 . . /5 4 7 5 . . /. . . . . . /5/EDGE/LINE/WALL/SHAPE/SURFACE/1 0 1 1 1 /"
],
[
"nmNotGiven",
"pzprv3/scrabble/3/4/g/. 1 . . /. 1 . . /. . . . /. . . . /. . . . /. 2 1 2 /2/AAB/BAB/0 0 /",
{ skiprules: true }
],
[
null,
"pzprv3/scrabble/3/4/g/. 1 . . /. 1 . . /. . . . /2 . 2 . /. . . . /. 2 . . /2/AAB/BAB/0 0 /",
{ skiprules: true }
],
[
null,
"pzprv3/scrabble/8/6/. . . . . . /. . . . . . /19 . . . . . /. . . 6 . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /. . . 19 . . /. . . 21 . . /. . . 18 . . /8 . . . . . /1 . 23 1 12 12 /16 . . 3 . 9 /5 4 7 5 . 14 /. . . . . 5 /5/EDGE/LINE/WALL/SHAPE/SURFACE/0 0 0 0 0 /"
Expand Down
Loading