Skip to content

Commit

Permalink
Add Persistence Of Memory
Browse files Browse the repository at this point in the history
  • Loading branch information
x-sheep authored Jan 8, 2024
1 parent 4f6df50 commit bfc6f26
Show file tree
Hide file tree
Showing 11 changed files with 666 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src-ui/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
<main>
<div style="margin-bottom: 5px;"><b>Latest types</b> (<em><a href="/list.html" target="_parent">all types</a></em>)</div>
<ul>
<li><a href="/p?pmemory" target="_parent">Persistence of Memory</a></li>
<li><a href="/p?mrtile" target="_parent">Mirroring Tile ミラーリングタイル</a></li>
<li><a href="/p?kissing" target="_parent">Kissing Polyominoes</a></li>
<li><a href="/p?lineofsight" target="_parent">Line of Sight サイトライン</a></li>
<li><a href="/p?tetrominous" target="_parent">Tetrominous</a></li>
<li><a href="/p?mannequin" target="_parent">Mannequin Gate マネキンゲート</a></li>
<li><a href="/p?nothing" target="_parent">All or Nothing オールorナッシング</a></li>
<li><a href="/p?alter" target="_parent">Alternation オルタネーション</a></li>
</ul>
</main>
</body>
Binary file added src-ui/img/pmemory.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src-ui/js/ui/Misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ function toBGimage(pid) {
"pencils",
"pentatouch",
"pentopia",
"pmemory",
"ququ",
"rassi",
"remlen",
Expand Down
1 change: 1 addition & 0 deletions src-ui/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
<li data-pid="mukkonn"></li>
<li data-pid="nothing"></li>
<li data-pid="lineofsight"></li>
<li data-pid="pmemory"></li>
</ul>
</div>
<div class="lists loops">
Expand Down
1 change: 1 addition & 0 deletions src/pzpr/variety.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@
"Pipelink Returns",
"pipelink"
],
pmemory: [0, 0, "Persistence of Memory", "Persistence of Memory"],
putteria: [0, 0, "プッテリア", "Putteria", "hanare"],
ququ: [0, 0, "区区", "Ququ"],
railpool: [0, 0, "Rail Pool", "Rail Pool"],
Expand Down
2 changes: 2 additions & 0 deletions src/res/failcode.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"bkCircleNe.fracdiv": "A number does not indicate the ratio of circles and cells in the area.",
"bkClue.toichika2": "A number does not match the clue for the country.",
"bkDifferentLetters.nikoji": "Two areas with different letters have the same shape.",
"bkDifferentLines.pmemory": "Two regions of the same shape have different lines.",
"bkDifferentOrientation.nikoji": "Two areas with equal letters have different orientation.",
"bkDifferentPosition.nikoji": "Two areas with equal letters have the letter in different positions.",
"bkDifferentShape.dbchoco": "The two shapes inside a block are different.",
Expand Down Expand Up @@ -509,6 +510,7 @@
"lcTripleNum.wblink": "Three or more objects are connected.",
"lcTripleNum": "Three or more numbers are connected.",
"lnAdjacent.ladders": "Two ladders touch.",
"lnAdjacent.pmemory": "The path loops back on itself.",
"lnAdjacent.tontti": "Identical line shapes are connected.",
"lnBranch": "There is a branch line.",
"lnConsecutive.kaidan": "Two adjacent rectangles don't have a size difference of 1.",
Expand Down
36 changes: 25 additions & 11 deletions src/variety-common/Encode.js
Original file line number Diff line number Diff line change
Expand Up @@ -805,36 +805,50 @@ pzpr.classmgr.makeCommon({
// enc.encodeIce() cell.ques===6をエンコードする
//---------------------------------------------------------------------------
decodeBinary: function(prop, val) {
var bstr = this.outbstr,
bd = this.board;
var bd = this.board;
this.genericDecodeBinary(bd.cell.length, function(c, newval) {
if (newval) {
bd.cell[c][prop] = val;
}
});
},
genericDecodeBinary: function(length, set_func) {
var bstr = this.outbstr;

var c = 0,
twi = [16, 8, 4, 2, 1];
for (var i = 0; i < bstr.length; i++) {
var num = parseInt(bstr.charAt(i), 32);
for (var w = 0; w < 5; w++) {
if (!!bd.cell[c]) {
if (num & twi[w]) {
bd.cell[c][prop] = val;
}
if (c < length) {
set_func(c, !!(num & twi[w]));
c++;
}
}
if (!bd.cell[c]) {
if (c >= length) {
break;
}
}
this.outbstr = bstr.substr(i + 1);
},
encodeBinary: function(prop, val, skipnone) {
var bd = this.board;
this.genericEncodeBinary(
bd.cell.length,
function(c) {
return bd.cell[c][prop] === val;
},
skipnone
);
},
genericEncodeBinary: function(length, get_func, skipnone) {
var cm = "",
num = 0,
pass = 0,
twi = [16, 8, 4, 2, 1],
bd = this.board;
twi = [16, 8, 4, 2, 1];
var found = false;
for (var c = 0; c < bd.cell.length; c++) {
if (bd.cell[c][prop] === val) {
for (var c = 0; c < length; c++) {
if (get_func(c)) {
pass += twi[num];
found = true;
}
Expand Down
14 changes: 10 additions & 4 deletions src/variety-common/MouseInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1009,19 +1009,25 @@ pzpr.classmgr.makeCommon({
}
},

mouseinputAutoPlay_line: function() {
mouseinputAutoPlay_line: function(withMB) {
if (this.btn === "left") {
if (this.mousestart || this.mousemove) {
this.inputLine();
} else if (this.mouseend && this.notInputted()) {
this.prevPos = new this.klass.Address();
this.inputpeke();
}
} else if (this.btn === "right") {
if (this.mousestart || this.mousemove) {
this.inputpeke();
}
}
if (this.mouseend && this.notInputted()) {
this.prevPos = new this.klass.Address();
if (!this.inputpeke_ifborder() && withMB) {
this.inputMB();
}
}
},
mouseinputAutoPlay_lineMB: function() {
this.mouseinputAutoPlay_line(true);
},

//---------------------------------------------------------------------------
Expand Down
Loading

1 comment on commit bfc6f26

@vercel
Copy link

@vercel vercel bot commented on bfc6f26 Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pzprjs – ./

pzprjs-robx.vercel.app
pzprjs-git-main-robx.vercel.app
pzprjs.vercel.app

Please sign in to comment.