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
1 change: 1 addition & 0 deletions src-ui/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
<li data-pid="tetrominous"></li>
<li data-pid="voxas"></li>
<li data-pid="narrow"></li>
<li data-pid="longest"></li>
</ul>
</div>
<div class="lists divides">
Expand Down
1 change: 1 addition & 0 deletions src/pzpr/variety.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@
lixloop: [0, 0, "LIX Loop", "LIX Loop", "yajilin"],
lohkous: [0, 0, "Lohkous", "Lohkous"],
lollipops: [0, 0, "ペロペロキャンディ", "Lollipops"],
longest: [0, 0, "短辺消失", "The Longest"],
lookair: [0, 0, "るっくえあ", "Look-Air"],
loopsp: [1, 0, "環状線スペシャル", "Loop Special", "pipelink"],
loute: [0, 0, "エルート", "L-route"],
Expand Down
3 changes: 3 additions & 0 deletions src/res/failcode.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@
"bdDeadEnd": "There is a dead-end line.",
"bdDoorsGt.oneroom": "Two rooms have more than one door between them.",
"bdEqual.antmill": "A square clue does not overlap two cells of the same color.",
"bdGivenUnused.longest": "A given line is not part of the longest border of an adjacent block.",
"bdIgnoreBP.bdblock": "A point has no line.",
"bdIgnoreBP.kramma": "A point has no line.",
"bdNotChassis.shwolf": "A line doesn't connect to the chassis.",
"bdNotGiven.longest": "A region's longest border uses non-given lines.",
"bdPassStar.nuriuzu": "A star overlaps a shaded cell.",
"bdPassStar.tentaisho": "A line goes over a star.",
"bdPierceGt1.blindrush": "A network of walls is pierced more than once.",
Expand Down Expand Up @@ -195,6 +197,7 @@
"bkNotAllMUPassed.dotchi2": "A line doesn't pass all white pearls.",
"bkNotAllMUPassed.moonsun": "A line doesn't pass all of the marks of the sun.",
"bkNotClosed.balloon": "A balloon is not enclosed by borders.",
"bkNotClosed.longest": "A region is not enclosed by borders.",
"bkNotHRect.tatamibari": "A tatami is not a horizontally long rectangle.",
"bkNotLshape.loute": "An area is not L-shaped or its width is not 1.",
"bkNotLshape3.shikaku": "An area whose size is a multiple of three is not L-shaped.",
Expand Down
53 changes: 53 additions & 0 deletions src/variety-common/Encode.js
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,59 @@ pzpr.classmgr.makeCommon({
this.outbstr += cm;
},

decodeOuterBorder: function() {
var bstr = this.outbstr,
bd = this.board,
twi = [16, 8, 4, 2, 1];
var pos = bstr
? Math.min(((bd.border.length + 4) / 5) | 0, bstr.length)
: 0,
id = 0;
for (var i = 0; i < pos; i++) {
var ca = parseInt(bstr.charAt(i), 32);
for (var w = 0; w < 5; w++) {
if (!!bd.border[id]) {
bd.border[id].ques = ca & twi[w] ? 1 : 0;
id++;
}
}
}
this.outbstr = bstr.substr(pos);
},
encodeOuterBorder: function() {
var hasoutside = 0,
bd = this.board;
var bdinside = 2 * bd.cols * bd.rows - bd.cols - bd.rows;
for (var id = bdinside; id < bd.border.length && !hasoutside; id++) {
if (bd.border[id].isLineNG()) {
hasoutside = true;
}
}
var num = 0,
pass = 0,
cm = "",
twi = [16, 8, 4, 2, 1];
for (
var id = 0, max = !hasoutside ? bdinside : bd.border.length;
id < max;
id++
) {
if (bd.border[id].isLineNG()) {
pass += twi[num];
}
num++;
if (num === 5) {
cm += pass.toString(32);
num = 0;
pass = 0;
}
}
if (num > 0) {
cm += pass.toString(32);
}
this.outbstr += cm;
},

//---------------------------------------------------------------------------
// enc.decodeCrossMark() 黒点をデコードする
// enc.encodeCrossMark() 黒点をエンコードする
Expand Down
46 changes: 2 additions & 44 deletions src/variety/cbblock.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,52 +463,10 @@
// URLエンコード/デコード処理
"Encode@cbblock": {
decodePzpr: function(type) {
this.decodeCBBlock();
this.decodeOuterBorder();
},
encodePzpr: function(type) {
this.encodeCBBlock();
},

decodeCBBlock: function() {
var bstr = this.outbstr,
bd = this.board,
twi = [16, 8, 4, 2, 1];
var pos = bstr
? Math.min(((bd.border.length + 4) / 5) | 0, bstr.length)
: 0,
id = 0;
for (var i = 0; i < pos; i++) {
var ca = parseInt(bstr.charAt(i), 32);
for (var w = 0; w < 5; w++) {
if (!!bd.border[id]) {
bd.border[id].ques = ca & twi[w] ? 1 : 0;
id++;
}
}
}
this.outbstr = bstr.substr(pos);
},
encodeCBBlock: function() {
var num = 0,
pass = 0,
cm = "",
bd = this.board,
twi = [16, 8, 4, 2, 1];
for (var id = 0, max = bd.border.length; id < max; id++) {
if (bd.border[id].isGround()) {
pass += twi[num];
}
num++;
if (num === 5) {
cm += pass.toString(32);
num = 0;
pass = 0;
}
}
if (num > 0) {
cm += pass.toString(32);
}
this.outbstr += cm;
this.encodeOuterBorder();
}
},

Expand Down
Loading
Loading