Esoteric Programming Language: PBrain Interpreter using C Language

0 22

PBrain is a procedural brainf*ck

brainf*ck instructions:

. -> output a character from current memory cell

, -> input a character and put into current memory cell 

+ -> increment current memory cell value

- -> decrement current memory cell value

< -> move current cell pointer backwards

> -> move current cell pointer forward

[ -> if current memory cell value is zero jump forward after matching ]
     else continue to next instruction
 
] -> if current memory cell value is not zero jump backward after matching [
     else continue to next instruction
pbrain additional instructions:

( -> start procedure numbered by current memory cell 

) -> end procedure

: -> call procedure numbered by current memory cell

# Sample Progrsm
[-](-[>+<-------]>-.+.)      # Proc0 = Print "HI" 
[-]+([-]+++++++++++++.---.)  # Proc1 = Print NewLine LineFeed
[-]:                         # Call Proc0
[-]+:                        # Call Proc1 

Source Code: https://github.com/rald/pbdos

1
$ 0.05
$ 0.05 from @Ceddy-lim

Comments