#Self-modifying Brainfuck, 28 19 bytes
Self-modifying Brainfuck, 28 19 bytes
␀
represents a literal NUL
byte.
<[.<]␀!dlroW ,olleH
This is my Python interpreter that is referenced on the Esolangs page for SMBF. The default/example program is the program above. The SMBF code is entered on line 178 so that the Input box can be used for STDIN.
If input is not empty, it would need to be this (20 bytes):
<[.+<]␀!dlroW ,olleH
Since SMBF has its own source code on the same tape, we put the string on the tape in reverse to facilitate printing. Then we print all the cells from right to left up to the cell with zero in it (the cell represented by ␀
). After printing, I have to change the comma to a different character so it doesn't look for input. Using +
changes it to a -
and vice versa, so either way it's a no-op (not that it matters, since printing is done anyway).