You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-24Lines changed: 29 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -4,44 +4,49 @@ For practise reasons, i implemented this Brainfuck Interpreter on a long train r
4
4
It works completely at compile time, as it is implemented in a purely functional way, expressed in C++ Template Language.
5
5
6
6
The program and user input is provided via type lists, and the output is a type list again.
7
-
The output string, as well as the Brainfuck Machine state can be printed as a compiler error message.
8
-
Of course, it would also be possible to write code which prints the output on the terminal, when the compiled program is being run.
7
+
The output string, as well as the Brainfuck Machine state can be printed as a compiler error message, or on the terminal when launching the program after compilation.
9
8
10
9
## Usage
11
10
12
-
The program is encoded like this in the source code:
13
-
```c++
14
-
using input_list = char_tl_t<'a', 'b', 'c'>;
15
-
using prog = char_tl_t<'+', '+', '+', '[', '.', '-', ']'>;
16
-
17
-
using BFM = bfm::io_bfm<bfm::make_t, input_list, tl::null_t>;
18
-
19
-
debug_t<bfm::run_tm_t<BFM, prog>::output> t;
11
+
Program and user input are provided via preprocessor macros on the command line:
12
+
```bash
13
+
Jacek.Galowicz ~/src/tmp_brainfuck $ g++ -o main main.cpp -std=c++14 -DINPUT_STR=\"z\" -DPROGRAM_STR=\",[.-]\"
0 commit comments