Recently, I've been trying to solve some of the SPOJ problems in Whitespace (don't ask why, I'm crazy
). Unfortunately, I have been met by NZEC...
I assumed that, just like one of the interpreters I had downloaded, the interpreter used by the judge only reads the first number on a line, discarding the rest. This put problems whose input contains multiple numbers per line temporarily out of reach, so I implemented my own input subroutine (like I said, I'm crazy). It reads stdin byte-by-byte, building a number as it goes along, until it reaches a character with ASCII code under 48 (zero).
However, I'm still getting NZEC. The only explanation I can think of is that EOF returns with NZEC rather than giving character -1. Is this true? And if so, how can this problem be fixed?