BFP

From Esolang
Jump to navigation Jump to search

BFP (short for Brainfuck Pro) is a variant and enhacment of Brainfuck, a famous esoteric programming language by Urban Müller.

Commands

Here are the commands:

  • >E Moves the cell cursor to the right.
  • W< Moves the cell cursor to the left.
  • +ADD+ Adds the number the cell cursor is pointing at by 1.
  • -SUBTRACT- Subtracts the number the cell cursor is pointing at by 1.
  • REPEAT { } Loop structure for repeating block of code.
  • ---OUTPUT. Adds an output to the number the cell cursor is pointing at.
  • ,INPUT--- Adds an input to the number the cell cursor is pointing at.
  • PRINT ( ) Adds a string or value instead of just the ASCII representation.
  • IF { } Conditional logic to execute code if a condition is true.
  • IF { } ELSE{ } Conditional logic with a else block.
  • << >> Comment syntax to add explanations to the code.

"Hello, World" program

> E +ADD+ +ADD+ +ADD+ +ADD+ +ADD+ +ADD+ PRINT(Hello) << Set up for 'H' >>
> E +ADD+ +ADD+ +ADD+ +ADD+ PRINT(e) << Set up for 'e' >>
> E +ADD+ +ADD+ +ADD+ +ADD+ PRINT(l) << Set up for 'l' >>
> E +ADD+ +ADD+ +ADD+ PRINT(l) << Set up for 'l' >>
> E +ADD+ +ADD+ +ADD+ +ADD+ PRINT(o) << Set up for 'o' >>
W < +ADD+ +ADD+ +ADD+ PRINT( ) << Add space >>
> E +ADD+ +ADD+ PRINT(W) << Set up for 'W' >>
> E +ADD+ +ADD+ +ADD+ PRINT(o) << Set up for 'o' >>
> E +ADD+ +ADD+ PRINT(r) << Set up for 'r' >>
> E +ADD+ +ADD+ PRINT(l) << Set up for 'l' >>
> E +ADD+ +ADD+ PRINT(d) << Set up for 'd' >>