« first day (767 days earlier)      last day (1727 days later) » 

12:16 AM
Actually, just Console.Read works when it's not reading from a terminal: tio.run/##NcuxCsIwEIDhOfcUNyaDXRw7OgkKYgeH0uG4hnjQJnAXBZE@e@zi/…
It looks like you're the one doing buffering somewhere...
I wish I figured this out before I spent a needlesly long time trying to call an unbuffered getchar from libc through InteropServices...
do {
	char c = (char)Console.In.Read();
	s += c;
	if(char.IsWhiteSpace(c))
		break;
} while(true);
Found it
@Draco18s That won't hit a whitespace character when the input ends. You should check if it's whitespace or null, which signifies the end of input.
 
Thanks for that, will work on it
 
Also, why not just use Console.ReadLine
Like do you really need it to seperate on spaces
 
Because the instruction pointers are stack based. and there are multiple pointers.
 
That explains nothing
 
How else would I hadle IP1 reading part of the input so that IP2 reads the rest?
 
12:26 AM
Ah, I see what it's doing.
Anyway, += on strings is really bad, you should consider using a StringBuilder instead
It's fine to use it once but in a loop it's much slower since it allocates a new string each time
 
That is also true. I am aware of string builder, but haven't used it much
 
12:38 AM
@Draco18s My bad, don't check for null, check the result of Console.Read for -1.
 
so:
char c = (char)Console.In.Read();
if(char.IsWhiteSpace(c) || c == -1) break;
?
 
No, check for -1 before casting to char
 
ah, ok
Hmm, still not getting it to skip past when there's nothing left to read. Even using a breakpoint, its never hit
*tries something*
int q = Console.In.Peek();
if(q < 0) break;
MIGHT work. It works as a local console app for all subsequent reads (the first one waits for input).
thoughts @Pavel ?
 
1:04 AM
It should, yeah
Although it requires input is seekable
Which is true almost in every case
 
Heh, should be.
 

« first day (767 days earlier)      last day (1727 days later) »