Created
March 12, 2023 02:35
-
-
Save johnrigler/955442aac88b387eaa60b4638272e2cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://ipfs.io/ipfs/QmXrwZC7E6dweXepYXkZ8T5bY2jiHbatYyHR2BKrbbf5qj"></script> | |
<script> | |
Stack = new Array(); | |
function evalStack(x) { eval(`${JSON.parse(Stack[x]).name} = ${JSON.parse(Stack[x]).value}`); } | |
const urlParams = new URLSearchParams(document.location.search); | |
id = urlParams.get('id'); | |
peer = new Peer(id); | |
peer.on('connection', (c) => { | |
c.on('data', (d) => { | |
e=d.split(" ")[0]; | |
f=d.split(" ")[1]; | |
if(e == 'eval')eval(d.slice(5)); | |
if(e == 'cons')console.log(eval(d.slice(5))); | |
if(e == 'push'){ | |
Stack.push(JSON.stringify( | |
{ "name":f,"value":d.slice(f.length + 6)} | |
)); } | |
if(e == 'func'){ | |
eval(f + "=" + d.slice(f.length + 6)) | |
} | |
}); }); </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment