NOTE! I think I broke the interpreter at some point, I might fix it, or not
This is a simple Befunge interpreter which I call Befungo, due to the slight modifications I've made ;)
Reference: https://en.wikipedia.org/wiki/Befunge
I've added "t", or goto, which pops y, x, and goes to those coordinates.
To make it easier to return, I also added "l"ocation, which pushes x, y to the stack
This allows functions :D !
Try out the code below!
2l\7+\15t (expecting 3)
@@@@@@@@@@@@@@@@@@@@@@@@@@
@function: add 1 to input@
@input (stack): ixy @
@@@@@@@@@@@@@@@@@@@@@@@@@@
@x16p26p1+26g16gt @
@ @
@@@@@@@@@@@@@@@@@@@@@@@@@@
Or print a pyramid (add missing blank line at end and spaces):
&:18p28pv
v <
>v >1-" ",v >1-"#",v >1-" ",v
> 28g:|>:|> $18g28g-2*1+>:|> $$28g>:|
@ >^ >^ ^ <
^ < ^ <
^ ,+19p82-1g82$<
Or print a program which will print itself (add missing blank line at end and spaces):
706p "&"16p 026p 036p v
v , g g62 _ v# -\ g61 :g63 <
> 36g 1 + 36p #$ ^
v,+49 _v# -\ g60 g62 <
> 26g #@ 1 + 26p 036p ^