Closed abhra2020-smart closed 3 years ago
The interpreter should be able to receive the bit size from a parameter on the interpreter function. So that you can pass a value from the compiler with for example --interpreter-bits 16
I think you forgot to add the expression to the -
instruction
Please make the interpreter receive an optional flag indicating the cell bit size :)
When this gets merged (after the changes) i will make some library functions that are related to this and are very much needed.
You should pass the bits variable to the brainfuck function. And in the definition https://github.com/elikaski/BF-it/blob/735f276cef40e0e567a473cf8871b11a4ca70180/Interpreter.py#L27
You should add , bits=8
so you can call this function from another file. Since you can run the compiled code from the compiler
Made changes.
That was a misclick
Excellent! Thank you :) You missed 2 things that I mentioned. I tagged you in them so you will see They are:
nargs=1
to the -b argument2 ** bits - 1
Please add these and I'll merge :)
Excellent! Thank you :) You missed 2 things that I mentioned. I tagged you in them so you will see They are:
- Adding
nargs=1
to the -b argument- Adding the bits calculation to the "-" instruction, similar to the "+" instruction Currently the value "255" is hard-coded, it should be
2 ** bits - 1
Please add these and I'll merge :)
(for some reason I can't tag you, so I kept these conversations as "unresolved")
Hopefully the final commit has been made
I think that everything looks good. Only thing is the file opening. The old version used with open(...) as f:
The f.close() is unnecessary since the with statement does that automatically
Merged, thank you :)
Add customizability to how much bit ints there are