splitreverse

From Esolang
Jump to navigation Jump to search

splitreverse is a progrmming language that splits the input into two pieces and reverses the second piece and combines them:

input: abcd
output: adcb

more complex:

input: abcd+hello
output--: adcb+holle
output-: adcbholle
output: aellohbcd

even more complex:

input: *(abcd)+e
output---: *(adcb)+e
output--: abcd+e
output-: abcde
output: aedcb

extremely complex:

input: and=another
output---: another=and
output--: arehton=adn
output-: arehtonadn
output: andanother

even even even even more complex:

input: ab\+c
output---: ac+\b
output--: ac+b\
output-: acb\
output: a\bc

the most complex:

input: ab#
output-*infinity: a#b
output-*infinity-1: aab#b
output-*infinity-2: aa#bb
output-*infinity-3: aaab#bb
...

hello world:

input: hdlrow olle
output: hello world

unary increment:

input: ^^^+^
output--: ^^^+^
output-: ^^^^
output: ^^^^

hello 2:

input: *(*(he)+llo)
output---: *(*(eh)+llo)
output--: *(he+llo)
output-: *(holle)
output: hello

commands:

abcd -> adcb
abcd+efgh -> adcb+ehgf -> adcbehgf -> afghebcd
*(abcd) -> *(adcb) -> abcd
abcd=efgh -> efgh=abcd -> ehgf=adcb -> ehgfadcb -> ebcdafgh
\c -> \c (c is a command, \ cancels the command)
# -> inserts the whole code and runs it, note: last precedence