Skip to content

Feeling too good about yourself? Try Brainfuck++, more fucked than ever!

License

Notifications You must be signed in to change notification settings

itismeherb/bfppc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brainfuck++ Compiler

Because regular Brainfuck wasn't nearly fucked enough.

Why?

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.

Features

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.

Brainfuck++ Additions (because why the hell not)

  • ;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.

Installation (if you’re still reading this)

Build from source (the classic descent into madness)

git clone https://github.com/itismeherb/bfppc
cd bfppc
make
sudo make install

Custom installation path (for the organized masochist)

make install PREFIX=$HOME/.local
export PATH="$HOME/.local/bin:$PATH"

How the Random Range Actually Works (Spoiler: It’s janky)

You have three cells in a row. Imagine them.

Before:          After:
┌───┬───┬───┐    ┌───┬───┬───┐
│ 5 │ ? │ 15│    │ 5 │ 9 │ 15│
└───┴───┴───┘    └───┴───┴───┘
  ^   ^   ^        ^   ^   ^
 min ptr max      min ptr max

The 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.

About

Feeling too good about yourself? Try Brainfuck++, more fucked than ever!

Resources

License

Stars

Watchers

Forks

Packages

No packages published