brainfuck
v2.7.3
Cに書かれたBrainfuck通訳者
brainfuck [-veh] file...
-e --eval run code directly
-v --version show version information
-h --help show a help message.
インタラクティブコンソールには、引数が渡されないことでアクセスできます。
また、C APIを提供します。
#include <stdio.h>
#include <stdlib.h>
#include <brainfuck.h>
int main () {
BrainfuckState * state = brainfuck_state ();
BrainfuckExecutionContext * context = brainfuck_context ( BRAINFUCK_TAPE_SIZE );
BrainfuckInstruction * instruction = brainfuck_parse_string ( ",+++++." );
brainfuck_add ( state , instruction );
brainfuck_execute ( state -> root , context );
brainfuck_destroy_context ( context );
brainfuck_destroy_state ( state );
return EXIT_SUCCESS ;
}例/ディレクトリには、大量のBrainFuck例プログラムが含まれています。可能であれば、これらのプログラムの元の著者を帰しようとしました。
コマンドプロンプトで次のコードを実行してソースコードをダウンロードしてください。
$ git clone https://github.com/fabianishere/brainfuck.gitまたは、ソースコードのコピーをzipファイルとして取得するだけです。
ビルドディレクトリを作成します。
$ mkdir build
$ cd buildBrainFuckは、実行するためにCmakeとC Compiler(ClangまたはGCCなど)を必要とします。また、ほとんどのLinuxディストリビューションのメインリポジトリ(Debian/ubuntuのLibedit-Devなど)で利用できるLibeditにも依存し、Macos Xcodeコマンドラインツールが付属しています。次に、MakeFilesを作成するだけです。
$ cmake ..そして最後に、選択した建物システムを使用して構築します(例:make):
$ makeAfter the build has been finished, you may install the binaries to your local system (see CMAKE_INSTALL_PREFIX for information about the install prefix):
$ make installまたは、インストールなしでインタープリターを直接実行することもできます。
$ ./brainfuck ../examples/hello.bfこのコードは、Apacheライセンスバージョン2.0でリリースされます。 license.txtを参照してください。
Fabian Mastenbroek https://github.com/fabianishere
aliclubb https://github.com/aliclubb
diekmann https://github.com/diekmann
SevenBits https://github.com/SevenBits
Alex Burka https://github.com/durka
outis https://github.com/outis
rien333 https://github.com/rien333
boweiliu https://github.com/boweiliu
Rotartsi https://github.com/ROTARTSI82
Saket Upadhyay https://github.com/Saket-Upadhyay
outis https://github.com/outis
Jalmari91 https://github.com/Jalmari91
Alok Singh https://github.com/alok
Lasse Damsgaard Skaalum https://github.com/humleflue