Back to General discussions forum
Hello,
could somebody please tell me how the comma operator in Brainfuck works?
I tried to solve problem 168, but the answer is wrong. On my Windows-PC I get the correct answer!
Code:
,#---------- ---------- ---------- ---------- ------ [$.
,#---------- ---------- ---------- ---------- ------ ]
The program reads one character ahead and the following characters within the loop. As I said this works perfectly well on my PC, but the checker says that the program tries to read more characters than are there. When I omit the last but second line there is a stackerror on my PC, but the checker just says, that the answer is wrong.
When I use the code that you submitted, on the problem's page, with the example data, your code just produces "U".
"comma" takes one character from input and puts its ASCII code to the current memory cell.
Thank you for the quick response. I tried again, this time copying the code more carefully - and it worked!
Maybe the first time I included a semicolon from the C# source?!
Anyway it's solved now.
Thanks again