Skip to content

Commit a0098f3

Browse files
authored
Update JAGL.html
1 parent a97324a commit a0098f3

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

JAGL/JAGL.html

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
JAGL - Just a Golf Language<br>
22
<input type="text" placeholder="code" id="c">
33
<input type="text" placeholder="input" id="i"><br>
4-
output:<p id="out"></p>
4+
output:<p id="o"></p>
55
<input type="button" value="Execute" onclick="ce()"><br>
66
<script>
77
function ce(){
8-
c=document.getElementById("c").value;
9-
i=document.getElementById("i").value;
10-
o=[]
11-
alert(c+", "+i)
8+
c=document.getElementById("c").value
9+
i=document.getElementById("i").value
10+
c=[...c];i=[...i];o=[];ip=0;m=0;t=""
11+
while (c.length>ip){
12+
if (c[0]=="@"){m=1}
13+
if (m==1){if (c!="@"){o.push(c[0])};if (c=="@"){m=1;o.shift()}}
14+
c.shift()}
15+
while (o.length>0){t=o[0]+o[1];c.shift();c.shift();c.reverse();c.push(t);c.reverse}
16+
document.getElementById("o").innerHTML=o;
1217
}
1318
</script>

0 commit comments

Comments
 (0)