Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mkotha/bfi
A brainfuck interpreter on the C preprocessor
https://github.com/mkotha/bfi
Last synced: 25 days ago
JSON representation
A brainfuck interpreter on the C preprocessor
- Host: GitHub
- URL: https://github.com/mkotha/bfi
- Owner: mkotha
- License: other
- Created: 2013-11-10T10:51:19.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-11-27T11:51:48.000Z (about 11 years ago)
- Last Synced: 2024-08-03T18:16:59.157Z (4 months ago)
- Language: C
- Size: 143 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: copying.txt
Awesome Lists containing this project
- AwesomeInterpreter - bfi
- awesome-c-preprocessor - `mkotha/bfi` - - A brainfuck interpreter on the C preprocessor. (Compilers/Interpreters)
README
# Brainfuck interpreter on the C Preprocessor
## Usage
# include "bfi.h"
BFI_RUN(, )
BFI_RUN1()A BF program must be given in a special syntax. Replace +-><.,[] in
an ordinary BF program with x_bdwrLR, respectively. The instructions
must be separated with whitespaces, so that they will not be
recognized as a single token. In place of L and R, parentheses ( and
) can also be used, provided that a ) never directly follows a (.An input will be given as a sequence of bytes. Each byte is
represented by a 2-digit hexadecimal with lowercase letters.
Characters are encoded in ASCII.Example:
BFI_RUN(r (w (_) r), 0x61 0x62 0x63) /* => abc */
Letters, numbers and underscores can be written directly in an input
sequence. Pairs of parentheses can also be used, privided that the
content is not empty. There are some additional shorthands such as
0comma for comma and 0_n for the newline character. See lex.h for
detail.Example:
BFI_RUN(r (w (_) r), a b c (F 0comma 0space G) ) /* => abc(F, G) */