From 3e5cf5941db07bcd3527a73b62077d5277d57f2d Mon Sep 17 00:00:00 2001 From: Mincho Paskalev Date: Wed, 28 Nov 2018 09:42:47 +0200 Subject: Adding 3rd homework - Brainfuck Interpreter (#44) * Add 1st hw * --amend * moving readme for 1st hw to designated folder * renamed TokenType enum to TokenClass * fixed character constant lexing. added sampe output file * add new line at end-of-file. added gitignore * a bit of refactoring * Add BF interpreter --- homework/81568/BF_Interpreter/README.md | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 homework/81568/BF_Interpreter/README.md (limited to 'homework/81568/BF_Interpreter/README.md') diff --git a/homework/81568/BF_Interpreter/README.md b/homework/81568/BF_Interpreter/README.md new file mode 100644 index 0000000..b8cde8b --- /dev/null +++ b/homework/81568/BF_Interpreter/README.md @@ -0,0 +1,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. -- cgit v1.3.1-26-gb76a