def VM(code):
A = 0
types = [[0]]
Px = 0
Sx = 0
Py = 0
Sy = 0
Q = {}
loop = []
while A < len(code):
if code[A] == "↑":
if Py < (len(types)-1):
Py += 1
else:
types.append([0]*len(types[len(types)-1]))
Py += 1
elif code[A] == "↓":
if Py > 0:
Py -= 1
elif code[A] == "→":
if Px < (len(types[Py])-1):
Px += 1
else:
types[Py].append(0)
Px += 1
elif code[A] == "←":
if Px > 0:
Px -= 1
elif code[A] == "+":
types[Py][Px] = (types[Py][Px]+1)%96
elif code[A] == "-":
types[Py][Px] = (types[Py][Px]-1)%96
elif code[A] == "!":
Sx = Px
Sy = Py
elif code[A] == "?":
Px = Sx
Py = Sy
elif code[A] == "¡":
if A+1 < len(code):
Q[code[A+1]] = types[Py][Px]
elif code[A] == "¿":
if A+1 < len(code):
types[Py][Px] = Q[code[A+1]]
elif code[A] == "#":
types[Py][Px] = 0
elif code[A] == "(":
loop.append([1,A])
elif code[A] == ")":
if loop[len(loop)-1][0] == 1:
A = loop[len(loop)-1][1]
loop[len(loop)-1][0] = 0
else:
loop.pop(len(loop)-1)
elif code[A] == "/":
print(chr(types[Py][Px]%96),end = "")
A += 1
VM("""((((((+))))))¡a#→¿a((++))/¡.#←¿.(-)-/¡.#↑¿.((+++))((-))-/¡.#→¿./¡.#↑¿.+++/""")
To embed this project on your website, copy the following code and paste it into your website's HTML: