bfy/README.md

2.2 KiB

brainfuc*k interpreter

brainfuck interpreter: a simple brainfuck interpreter and REPL writen in rust 🦀

Install

  • from crates.io
    crago install bf-bf_interpreter
    
  • From aur:
    yay -S bf-interpreter
    

Options and arguments

bf-bf_interpreter --help
Brainfu*k interpreter and REPL written in Rust

Usage: bf-interpreter [OPTIONS] [SOURCE]

Arguments:
  [SOURCE]
          The brainfuck source code file to run (if not will be entered in REPL mode)

Options:
  -f, --features <FEATURES>
          Possible values:
          - reverse-counter:
            If the value is you want decrement the value and the value is 0, set the value to 255, otherwise decrement the value. If the value is you want increment the value and the value is 255, set the value to 0, otherwise increment the value
          - reverse-pointer:
            If the pointer at the end of the array, set the pointer to 0, otherwise increment the pointer. If the pointer at the beginning of the array, set the pointer to the end of the array, otherwise decrement the pointer

  -a, --array-size <ARRAY_SIZE>
          The brainfuck array size
          
          [default: 30000]

  -w, --without-tiles
          Dont print the tiles (e.g. exit code, file name, etc)

  -h, --help
          Print help information (use `-h` for a summary)

  -V, --version
          Print version information

Examples

bf-bf_interpreter test_code/hello_world.bf
Hello world!
Successfully ran brainfuck source code from file: test_code/hello_world.bf
Exiting with code: 0
bf-bf_interpreter -w test_code/hello_world.bf
Hello world!
bf-bf_interpreter test_code/print_hi_yooo.bf
Hi yoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo!Successfully ran brainfuck source code from file: test_code/print_hi_yooo.bf
Exiting with code: 0
bf-bf_interpreter -w test_code/print_hi_yooo.bf
Hi yoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo!
bf-bf_interpreter test_code/like_cat.bf

output