Website Summary Files Commits Branches @commit @diff @stats
path: root / homework / 81568 / BF_Interpreter / README.md
blob: b8cde8b17093a97c65390b4cf10185b455128cab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Brainfuck-Interpreter
Simple Brainfuck interpreter written for IPL course homework from FMI, SU, 2018.

Uses default memory size of 30000 cells but if you define `#MEMSIZE` with your compiler to something else you can get different size.

When either > or < instructions overflow the cell pointer, the latter just wraps
around.

# Installation
BFI uses _make_ for make for simplicity.

To install simply run:
```
make
```

# Usage
```
Usage: bfi [OPTIONS]

Options:
  -h,--help                   Print this help message and exit
  -f,--file FILE Excludes: --code
                              Brainfuck source file
  -c,--code TEXT Excludes: --file
                              Brainfuck source code
  -o,--output TEXT            File to write the Brainfuck output to. Optional.
  -i,--input FILE             File to take the Brainfuck input from. Optional.
```

# Future
BFI is planned to be made child-friendly by introducing new instructions like:

* ! - make the current cell value equal to 0.
* ^ - go to cell No. (current cell No. + current cell value).
* & - go to cell No. (current cell No. - current cell value).
* \# - if statement that depends on next value (for comparison) and previous (to use like ^)
* $ - same as above, but go back, instead of forward.

To be completely child-friendly change the name of the language to Brainmeddler.