zonble / brainfuck_dart

A sample command-line Brainfuck interpreter
MIT License
7 stars 0 forks source link

No rollback to min/max value of byte. #1

Closed kulishnik22 closed 2 years ago

kulishnik22 commented 2 years ago

Some Brainfuck programs rely on the principle that once the data at current pointer reaches -128 and you try to decrease it, it will rollback to 127. The same thing applies when you try to increase the value that is 127. It should rollback to -128. Example of such program is the current shortest Hello World program. Currently the shortest Hello World program in Brainfuck: +[>>>->-[>->----<<<]>>]>.---.>+..+++.>>.<.>>---.<<<.+++.------.<-.>>+. If you try to run it, it will be stuck in cycle. Possible solution is to change the type of "data" list from List to Uint8List

zonble commented 2 years ago

Fixed :)