Talk:Brain-Flak

From Esolang
Jump to navigation Jump to search

Sample Code output inconsistency

Two of the algorithms presented in this section care about order of output: Fibonacci and Quine, and they use it differently. Fibonacci assumes the stack is output bottom to top and places the first elements of the sequence on the bottom, while Quine seems to assume the stack is output top to bottom and puts the final characters of its source at the bottom. It's not a big issue, just slightly confusing. I'm not (yet) fluent enough in Brain-Flak to rewrite the quine myself. Olus2000 (talk) 17:42, 20 July 2023 (UTC)

Why can there be a quine since Brain-Flak doesn't seem to have character output?!

--None1 (talk) 07:57, 1 September 2023 (UTC)

According to the specification on this wiki, "When the program is done executing, each value left on the active stack is printed, with a newline between. Values on the other stack are ignored.". However, implementations vary as to which order they print the stack elements (bottom to top, or top to bottom), and whether they are printed as numbers or as characters. You can write a quine by putting the ASCII codes of your program onto the stack at program exit – this is conceptually a quine even if they are output as numbers, and a true quine if run in an implementation that outputs as characters. --ais523 20:15, 1 September 2023 (UTC)