Skip to content

Commit baaa975

Browse files
authored
Update ji.html
1 parent 080ea70 commit baaa975

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

jive/ji.html

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,12 @@
77
i = document.getElementById("i").value.split("\n")
88
code = document.getElementById("c").value
99
while (p < code.length) {
10-
if (code[p] == "*") {
11-
s.push(i.shift())
12-
} else if (code[p] == "↓") {
13-
out += s.pop()
14-
} else if (code[p] in num) {
15-
s.push(Number(code[p]))
16-
} else if (code[p] == "↑") {
17-
out += "["+s+"]"
18-
} else if (code[p] == "[") {
19-
while (code[p] !== "]") {p++}
20-
} else if (code[p] == "!") {
21-
s.push(fact(s.pop()))
10+
if (code[p] == "*") { s.push(i.shift())
11+
} else if (code[p] == "↓") { out += s.pop()
12+
} else if (code[p] in num) { s.push(Number(code[p]))
13+
} else if (code[p] == "↑") { out += "["+s+"]"
14+
} else if (code[p] == "[") { while (code[p] !== "]") {p++}
15+
} else if (code[p] == "!") { s.push(fact(s.pop()))
2216
} ; p++
2317
}
2418
//output the out variable

0 commit comments

Comments
 (0)