Brainfuck

所属分类:人工智能/神经网络/深度学习
开发工具:Brainfuck
文件大小:0KB
下载次数:0
上传日期:2020-09-05 18:26:01
上 传 者sh-1993
说明:  用C编写的快速Brainfuck解释器和编译器,
(A fast Brainfuck interpreter and compiler written in C,)

文件列表:
Brainfuck.cbp (1411, 2020-09-05)
LICENSE (35149, 2020-09-05)
res/ (0, 2020-09-05)
res/icon.ico (38207, 2020-09-05)
res/resource.rc (1494, 2020-09-05)
src/ (0, 2020-09-05)
src/bfi.h (2213, 2020-09-05)
src/bftoc.h (4821, 2020-09-05)
src/commons.h (1339, 2020-09-05)
src/main.c (18387, 2020-09-05)
src/stack.c (2027, 2020-09-05)
src/stack.h (1044, 2020-09-05)
test/ (0, 2020-09-05)
test/hanoi.bf (54593, 2020-09-05)
test/helloworld.bf (72, 2020-09-05)
test/mandelbrot.bf (11669, 2020-09-05)
test/sierpinski.bf (309, 2020-09-05)
test/square.bf (673, 2020-09-05)

Brainfuck Interpreter Logo # Brainfuck Brainfuck is an esoteric programming language created in 1993 by Urban Müller, and is notable for its extreme minimalism. The language consists of only eight simple commands and an instruction pointer. While it is fully Turing complete, it is not intended for practical use, but to challenge and amuse programmers. Brainfuck simply requires one to break commands into microscopic steps. The language's name is a reference to the slang term brainfuck, which refers to things so complicated or unusual that they exceed the limits of one's understanding.
## Brainfuck Interpreter This project provides a fast Brainfuck interpreter written in C. It is implemented with multiple optimizations to increase execution speed.
Default behaviour is to interpret and execute immediately. It is cross-platform compatible, and has been tested on Windows, Linux, and macOS.
## Brainfuck Compiler This project provides a fast Brainfuck compiler written in C. It converts brainfuck code to highly optimized C code and then compiles the C code into machine executable file using GCC. To compile brainfuck code, use the -c or --compile option. If desired, brainfuck code can be translated to C code without compiling to executable using the -x or --translate option. The generated C code is cross-platform compatible, and has been tested on Windows, Linux, and macOS.
## Usage brainfuck [options] #### Options -c --compile Translate to C and compile to machine code [requires GCC] -x --translate Translate to C but do not compile -t --tape Size of interpreter tape [must be equal to or above 1000] -s --stack Size of interpreter stack [must be equal to or above 100] -v --version Show product version and exit -i --info Show product information and exit -h --help Show this help message and exit __Note:__ Default behaviour is to interpret and execute immediately.
## Build Run the following commands inside src directory. gcc main.c -o main.o -c -O3 gcc stack.c -o stack.o -c -O3 gcc -o brainfuck main.o stack.o -O3
## Optimizations * Jumps between [ and ] * Compacts consecutive > and < * Compacts consecutive + and - * Optimizes [-] to set(0) * Optimizes [<] to scan_left(0) * Optimizes [>] to scan_right(0) * Removes consecutive > and < if the net movement is zero * Removes consecutive + and - if the net change is zero * Removes consecutive + and - if immediately followed by an input operation ( , )
## Credits The brainfuck interpreter/compiler icon is made by Smashicons from www.flaticon.com.

近期下载者

相关文件


收藏者