Painfuck

From Esolang
Jump to navigation Jump to search

Painfuck is an brainfuck derivative that has the mix of painful syntax and painful way to write. It gets hella obvious when shown below:

Commands

...

Commands
Text Function
p Add two to the selected value on tape
s Subtract one from the selected value on tape
r Go right two times on tape
l Go left on tape
i Get input and store as a number
j Get input and store as an ASCII value
o Output as number
u Output as character
a Go to the matching b if value on tape is zero
b Go back to the matching a if value on tape is not zero
k Square selected value on tape
z Zero selected value on tape
h Half the selected value on tape
w Clone the value to the right of selected
q Clone the value to the left of selected
c Do the next command 7 times
y Do the next command only half the time
e End program when reached
v Do next command if value on tape is zero
d Go back to the start of tape
t Do the last command 3 times

Then. After a command is executed, encrypt the ENTIRE rest of the code with this encryption scheme:

BEFORE: pysrlijouavbtkzhwqdec
AFTER : euopdhzbclkqsjwariyvt

This makes:

pso

Become:

ptt

And in order to run pso, you have to use that.

Or as another example,

ptptsso

Has to run like this:

pcwyydd

Looks nothing like the original, almost.

Examples

Remember, this chart will be used throughout:

BEFORE: pysrlijouavbtkzhwqdec
AFTER : euopdhzbclkqsjwariyvt

Cat program

Without decryption:

jaujb

With encryption (required to run):

jhdec

Looping counter

pticjdy

Hello, world!

NOTE: The program doesn't include newlines!!!!

crwydvoeprqddkveuwbldtveprsyjulephwzjtvsprwahkaeouztjkuypriihi
bbcrtyjklaswwzjlleprqjldteprwzyyuyhrazoqoosyyuyhoppiozjtveprwi

Implementations

A C++ interpreter by User:Bangyen.