BFI is a Brainfuck interpreter written in Java.
- Download the zip of this repository, and then unzip it. Or, clone the repository with the git command.
$ git clone https://github.com/zshiba/bfi.git- Move to the bfi directory.
- Compile the source.
$ javac -d . ./src/BFI.java- Run the interpreter. BFI supports input from stdin and file.
$ # input from stdin. This prints 0. (See also the Limitation section below.)
$ java BFI
++++++++++++++++++++++++++++++++++++++++++++++++.
0$ # input from stdin. This prints 0.
$ cat ./test/single_line.bf | java BFI
0$ # input from a file. This prints 0.
$ java BFI ./test/single_line.bf
0- Run other tests. First, move to the bfi/test directory. Then, run the shell script.
$ # run tests
$ ./run_tests.shNote: Currently, the file bfi/test/hello_world.bf is used as a place holder. Before using run_tests.sh, copy the hello world program from Brainfuck Hello_World! and paste it in the file.
To indicate the end of the command source with stdin, it is necessary to enter a newline character (hit the enter key) at the end of the command source and then send a EOF control (Ctrl+D).
Mac, JDK 1.8
MIT