Skip to content
This repository has been archived by the owner on Apr 2, 2023. It is now read-only.

TadaHrd/bfp-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brainfuck+ Compiler This also has a vscode extension named Brainfuck+ Syntax

It's in alpha right now

If you want an executable go here


How to code in this

Installation instructions

  1. Create a new file named bfp_file_name.bfp
  2. Download the bfp executable from this
  3. Copy the bfp executable to your folder with the file
  4. If there isn't a binary for your system, you must compile the project with Cargo
  5. Open a command prompt in the folder

How to run this:

  1. Run: bfp bfp_file_name.bfp bf_file_name.bf or ./bfp.exe bfp_file_name.bfp bf_file_name.bf if it doesn't work (bfp being the compiler executable)
  2. If you have Windows, you can download the interpreter
  3. On Windows, run:
    • interpreter bf_file_name.exe or ./interpreter.exe bf_file_name.bf if it doesn't work
  4. On other systems, you have to compile it (Instructions) and run it with an interpreter (I recommend tio.run)
  5. Enjoy writing in Brainfuck+ (tutorial)

Documentation

If you want to know how to make your first program, go to this

  1. Comments
    1. Single-line: //
    2. Multi-line: /* and */
  2. Keywords
    1. p
      • Print statement
      • Example usage: p "Hello, world!"
  3. Data types
    1. Chars
      • Declared with " and ended with "
    2. Strings
      • Declared with " and ended with "
  4. Escape sequences
    1. \" - " character
    2. \\ - \ character
    3. \n - Newline character
  5. Commands
    1. + - Adds 1 to the current cell
    2. - - Removes 1 from the current cell
    3. > - Moves the pointer right
    4. < - Moves the pointer left
    5. [ - Starts a while loop
      • Explanation:
      • When it ends it will find if the current cell is 0:
        • If it is; it will end the while loop
        • If it isn't; it will continue looping
    6. ] - Ends a while loop
    7. . - Prints the current cell value as an ASCII character
    8. , - Stores user input inside the current cell
    • Including ones stated earlier (Non-Brainfuck; only Brainfuck+)

Making your first program

  • Follow the installation instructions

    Hello, Brainfuck+:

    1. In the bfp_file_name.bfp file add this code:
      • p "Hello, Brainfuck+!"
    2. Now run this code (Instructions)
    3. It should print "Hello, Brainfuck+!"

If you have vscode; you can install the extension (it should ask automatically or download it from the top link)

About

Brainfuck+ compiler

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages