[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[computer-go] GTP, KGS, GoGui and WriteLn



Weird enough I had almost the same problem yesterday as Peter Drake
connecting Viking to GoGui using standard input/output. In theory this
should be easy in Delphi using ReadLn and WriteLn and setting the
"Compile as Console" linker option before compiling.

But everything froze after sending the name, just as Orego did with GTP.


Previously I had been using pipes to connect to kgsGtp (because console
input/output did not work).

My solution was to call the Windows API with GetConsoleHandle and
finally replacing WriteLn with WriteFile which sends a buffer of char so
there is no extra char sent. The strange thing is that Write (which
would not add any CR) did not work either.

My guess here is that goGui has a similar problem as KgsGtp had, but
perhaps not exactly the same.

I will test this idea at home tonight simply by adding an extra LF or CR
to the WriteFile. If this does not cause the problem then is it
something about
Wrtieln and consoles in windows that is the problem, otherwise I will
notify submit a bugreport to GoGui.

--
Magnus Persson
Center for Adaptive Behavior and Cognition


> 
> Aha!  This may be your problem.  System.out.println() appends its
> _own_ end-of-line character(s) to whatever you've asked it to print.
> 
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/