Shifted brainfuck
Jump to navigation
Jump to search
Shifted brainfuck is a brainfuck derivative which tells EOF well while reading.
+
, -
, <
, >
, [
, ]
work as original brainfuck. .
outputs the current memory cell as char if it's not zero, or read input if it is, remaining zero in case there's no more input.
To avoid confusion when a character has code zero, each charcode is added by 1, e.g. \x00
=> 1, 0
=> 49.
Versions that each cell moduloed by 257, 65537, 1414113, 4294967296 or nothing exist.
Compared to 257-wrap brainfuck, this variant is somehow more elegant when inputting or outputting, e.g. for a cat:
.[.[-].]
Zero is better used for special handle. For exact chars, generator are no large difference, they need bunch of code.