Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakerh400 committed Jan 24, 2021
1 parent db27ea6 commit 0d8d799
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hakerh400/esolangs",
"description": "Collection of interpreters for esoteric programming languages",
"version": "1.3.1",
"version": "1.3.2",
"author": "Thomas <[email protected]>",
"main": "index.js",
"contributors": [],
Expand Down
9 changes: 7 additions & 2 deletions src/langs/129/ctors.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,13 @@ class Stack extends Base{
return this.elems.shift();
}

dup(){
return new Stack(this.elems);
*dup(){
const stack = new Stack();

for(const elem of this.elems)
stack.push(yield [[elem, 'dup']]);

return stack.rev();
}

get int(){ return this.len; }
Expand Down
4 changes: 2 additions & 2 deletions src/langs/129/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const run = (src, input) => {
halt = 1;
return;
}

output.push(byte);
};

Expand Down Expand Up @@ -84,7 +84,7 @@ const run = (src, input) => {
if(DEBUG) log('Duplicate');
const s = mainStack.top();
if(!check(s)) return;
mainStack.push(s.dup());
mainStack.push(O.rec([s, 'dup']));
} break;

case '((()(()))())': {
Expand Down

0 comments on commit 0d8d799

Please sign in to comment.