Because regular Brainfuck wasn't nearly fucked enough.
I have no fucking idea. Neither will you. Look, it's 3 AM, I've had four energy drinks, and somewhere between "Hello, World!" and a mental breakdown, this happened. Don't ask questions you don't want the answers to.
Yeah, sure, all the standard Brainfuck stuff is here. ><+-.,[] — the whole miserable gang. But that's boring, so I added more ways to shoot yourself in the foot.
-
;— Comment
Ignores everything until the end of the line. Use it. For the love of god, use it. Your future self will thank you. -
()— Random number 0–255
Slams a random byte into the current cell. Because deterministic programming is for cowards. -
(<>)— Random in range
Reads the cell to the left (ptr-1) as the MIN, the cell to the right (ptr+1) as the MAX, and puts a random number between them in the current cell. The pointer doesn’t move, because moving is effort. -
#— Print as number
Outputs the current cell’s value as a decimal number, not ASCII. For when you’re tired of pretending bytes are letters. -
!— Debug
Prints the current cell position and its value to stderr. It’s basically a cry for help embedded in your code.
git clone https://github.com/itismeherb/bfppc
cd bfppc
make
sudo make installmake install PREFIX=$HOME/.local
export PATH="$HOME/.local/bin:$PATH"You have three cells in a row. Imagine them.
Before: After:
┌───┬───┬───┐ ┌───┬───┬───┐
│ 5 │ ? │ 15│ │ 5 │ 9 │ 15│
└───┴───┴───┘ └───┴───┴───┘
^ ^ ^ ^ ^ ^
min ptr max min ptr maxThe pointer is on the middle cell. It looks left (min=5), looks right (max=15), pulls a random number out of its ass (say, 9), and shoves it into the middle cell. The pointer stays put because, again, effort.
Warning: If min > max, it’ll probably just give you min and a side of disappointment. The universe is chaotic, but not that chaotic.
Look, I’m going to bed. If your program segfaults, that’s a feature. If it works, you probably used it wrong. Good luck. You’ll need it.