This Programming Language
Factoid: This programming language is a two-dimensional programming language closely related to
><> and more distantly Befunge. It is based on ><>.
1 character
>
An infinite loop. Like ><> and Befunge, code will wrap around in this programming language. Note that in the interpreter, this will not result in an infinite loop as the interpreter gives up after (by default) 2048 commands.
In fact, any command but ;
when by itself in a program would result in an infinite loop.
2 characters
1i
Outputs 1 indefinitely (theoretically). Any number from 0
to 9
would do pretty much the same.
3 characters
)s;
Finally! Something interesting! This is a cat
program which outputs its input.
4 characters
1~i;
Demonstrates the pop
(~
) function. Although this pushes 1
to the stack, it is popped and it outputs nothing. (Not very interesting, I know.)
5 characters
'a's;
Prints a
. This demonstrates the string parsing function: when an '
is encountered, the rest of the characters are pushed to the stack as character codes until another '
is encountered. This leads to the escape for '
being quite costly: '39&'
(Note: &
concatenates the top two numbers on the stack [e.g. 39
--> [3, 9]
| 39&
--> [39]
])
6 characters
123\i;
Demonstrates the right-shift function. 1
, 2
, and 3
are pushed onto the stack, then the stack is shifted right (by one position). The output of this program is 312
. \
can be replaced with |
(the left-shift operator) to shift the stack one position left instead of right. While this does not seem to be very interesting, it has a surprising number of applications in this programming language.