How do I write a "comment" containing a period (.) In Brainfuck?

Is there a way to make comments in Brainfuck that contain periods ('.')?

I know I can basically use every char that is not one of the commands and is ignored, but I would like to put the version number in a comment at the top of the file and contain a period.

+3


source to share


1 answer


Here's a trick you can use: the loop will not execute what's inside unless it is executed and syntactically appropriate.

[This is a comment.]+++++++++++++++++++++++++++++++.

      

Indeed, if you don't specify []

, this will print too many NUL bytes. You still can't use parentheses though;)



This is similar to the shell construction:

if false; then
    this is a comment
fi

      

+4


source







All Articles