Re: stdin/stdout and flush

2019-08-27 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 27 August 2019 at 21:42:55 UTC, a11e99z wrote: On Tuesday, 27 August 2019 at 21:01:58 UTC, Andre Pany wrote: On Tuesday, 27 August 2019 at 20:45:44 UTC, a11e99z wrote: On Tuesday, 27 August 2019 at 20:09:34 UTC, Andre Pany wrote: "b" should send data in loop too, then "a" will

Re: stdin/stdout and flush

2019-08-27 Thread a11e99z via Digitalmars-d-learn
On Tuesday, 27 August 2019 at 21:01:58 UTC, Andre Pany wrote: On Tuesday, 27 August 2019 at 20:45:44 UTC, a11e99z wrote: On Tuesday, 27 August 2019 at 20:09:34 UTC, Andre Pany wrote: "b" should send data in loop too, then "a" will work ok. do u still hack CodinGame? :)

Re: stdin/stdout and flush

2019-08-27 Thread a11e99z via Digitalmars-d-learn
On Tuesday, 27 August 2019 at 21:28:05 UTC, a11e99z wrote: On Tuesday, 27 August 2019 at 21:01:58 UTC, Andre Pany wrote: On Tuesday, 27 August 2019 at 20:45:44 UTC, a11e99z wrote: On Tuesday, 27 August 2019 at 20:09:34 UTC, Andre Pany wrote: what result u expecting? then u send from "b"

Re: stdin/stdout and flush

2019-08-27 Thread a11e99z via Digitalmars-d-learn
On Tuesday, 27 August 2019 at 21:01:58 UTC, Andre Pany wrote: On Tuesday, 27 August 2019 at 20:45:44 UTC, a11e99z wrote: On Tuesday, 27 August 2019 at 20:09:34 UTC, Andre Pany wrote: what result u expecting? u send from "b": e1 10 e2 9 "a" read it. 1st loop finished. then u send from "b"

Re: stdin/stdout and flush

2019-08-27 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 27 August 2019 at 20:45:44 UTC, a11e99z wrote: On Tuesday, 27 August 2019 at 20:09:34 UTC, Andre Pany wrote: This applications will be called by a second application: import std; void main() { auto p = pipeShell("a", Redirect.all); p.stdin.writeln("e1");

Re: stdin/stdout and flush

2019-08-27 Thread a11e99z via Digitalmars-d-learn
On Tuesday, 27 August 2019 at 20:09:34 UTC, Andre Pany wrote: This applications will be called by a second application: import std; void main() { auto p = pipeShell("a", Redirect.all); p.stdin.writeln("e1"); p.stdin.writeln("10"); p.stdin.writeln("e2"); p.stdin.writeln("9");

stdin/stdout and flush

2019-08-27 Thread Andre Pany via Digitalmars-d-learn
Hi, I have a small application like this: ---a.d import std; void main() { while(true) { string enemy1 = readln.strip; int dist1 = to!int(readln.strip); string enemy2 = readln.strip; int dist2 = to!int(readln.strip); writeln((dist1 < dist2) ?