Reply
 
LinkBack Thread Tools Display Modes
  #1   Report Post  
Old January 6th 04, 07:52 PM
John Vinyard
 
Posts: n/a
Default Xboard interface

I'm writing a simple chess program, and I'd like it to play on chess.net.
I've got it running, with its own interface, and i can get icsdrone to
connect as my (C) account on chess.net. Howevever, I can't get my program
to talk using the Xboard interface correctly. Using xboard, I know that my
program is recieving input correctly, due to how it crashes, but it won't
send any moves back to xboard. After looking at open-source programs like
crafty and reading through Tim Mann's interface FAQ, I still can't see what
I'm doing wrong.

I'm using c++, compiling with g++ on Solaris 8. I'm using cin for input and
cout for output. I'm using cout.setf(ios::unitbuf), as well as cout.flush()
after every to cout, so I don't think that buffered iput/output is the
problem. Right now i'm trying to just send a hardcoded move, using
something like:

cin command;
while( command != "?"){
cin command;
}
cout "move e7e6" endl;
cout.flush()

If someone could help me out I'd really appreciate it. Even something like
a "record" of the transactions between xboard and a "normal" program would
be greatly appreciated.

John Vinyard



  #2   Report Post  
Old January 7th 04, 07:07 AM
Werner Mühlpfordt
 
Posts: n/a
Default Xboard interface

For me, using Linux/g++, it's good enough to just say

std::cout "move e7e6" std::endl;

endl is expected to flush the buffer - no ios:: magic required.

Werner
  #3   Report Post  
Old January 7th 04, 04:36 PM
Peter Sch?fer
 
Posts: n/a
Default Xboard interface

"John Vinyard" wrote in message ...

If someone could help me out I'd really appreciate it. Even something like
a "record" of the transactions between xboard and a "normal" program would
be greatly appreciated.

John Vinyard


you might try: http://jose-chess.sourceforge.net

"Window/Engine Console" gives you a log of all communication between
the GUI and your engine.
  #4   Report Post  
Old January 7th 04, 05:00 PM
John Vinyard
 
Posts: n/a
Default Xboard interface

Doesn't the line "using namespace std;" make that equivalent?

- John Vinyard

"Werner Mühlpfordt" wrote in message
...
For me, using Linux/g++, it's good enough to just say

std::cout "move e7e6" std::endl;

endl is expected to flush the buffer - no ios:: magic required.

Werner



  #5   Report Post  
Old January 7th 04, 05:25 PM
Thomas T. Veldhouse
 
Posts: n/a
Default Xboard interface

On Wed, 7 Jan 2004 09:00:11 -0800, "John Vinyard"
wrote:

Doesn't the line "using namespace std;" make that equivalent?

- John Vinyard

"Werner Mühlpfordt" wrote in message
...
For me, using Linux/g++, it's good enough to just say

std::cout "move e7e6" std::endl;

endl is expected to flush the buffer - no ios:: magic required.

Werner




"using namespace std" should be avoided because it brings EVERYTHING
from the namespace into yours and chances are very good that what you
need is a VERY SMALL subset of it. Doing that defeats the purpose of
having a namespace in the first place. Much better is to:

using std::cout;
using std::endl;

cout "move e7e6" endl;



Tom Veldhouse


  #6   Report Post  
Old January 7th 04, 07:14 PM
Noah Roberts
 
Posts: n/a
Default Xboard interface

John Vinyard wrote:
I'm writing a simple chess program, and I'd like it to play on chess.net.
I've got it running, with its own interface, and i can get icsdrone to
connect as my (C) account on chess.net. Howevever, I can't get my program
to talk using the Xboard interface correctly. Using xboard, I know that my
program is recieving input correctly, due to how it crashes, but it won't
send any moves back to xboard. After looking at open-source programs like
crafty and reading through Tim Mann's interface FAQ, I still can't see what
I'm doing wrong.

I'm using c++, compiling with g++ on Solaris 8. I'm using cin for input and
cout for output. I'm using cout.setf(ios::unitbuf), as well as cout.flush()
after every to cout, so I don't think that buffered iput/output is the
problem. Right now i'm trying to just send a hardcoded move, using
something like:


Try cin.rdbuf()-pubsetbuf(0,0);

cin command;


  #7   Report Post  
Old January 8th 04, 02:25 AM
Filipe Maia
 
Posts: n/a
Default Xboard interface

On Tue, 6 Jan 2004 11:52:07 -0800, John Vinyard
wrote:
endl;
cout.flush()

If someone could help me out I'd really appreciate it. Even something
like
a "record" of the transactions between xboard and a "normal" program
would
be greatly appreciated.


xboard has a -debug flag.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
  #8   Report Post  
Old January 8th 04, 07:35 AM
Alexander Belov
 
Posts: n/a
Default Xboard interface


"Noah Roberts" wrote in message
...
John Vinyard wrote:
I'm writing a simple chess program, and I'd like it to play on

chess.net.
I've got it running, with its own interface, and i can get icsdrone to
connect as my (C) account on chess.net. Howevever, I can't get my

program
to talk using the Xboard interface correctly. Using xboard, I know that

my
program is recieving input correctly, due to how it crashes, but it

won't
send any moves back to xboard. After looking at open-source programs

like
crafty and reading through Tim Mann's interface FAQ, I still can't see

what
I'm doing wrong.

I'm using c++, compiling with g++ on Solaris 8. I'm using cin for input

and
cout for output. I'm using cout.setf(ios::unitbuf), as well as

cout.flush()
after every to cout, so I don't think that buffered iput/output is

the
problem. Right now i'm trying to just send a hardcoded move, using
something like:


Try cin.rdbuf()-pubsetbuf(0,0);

cin command;



And cout.rdbuf()-pubsetbuf(0,0);
Which is more important because the problem is in output.
Also if the input is made blocking (without check for data readiness),
input and output with move logic have to work in two different threads.


  #9   Report Post  
Old January 9th 04, 05:53 PM
GymRat
 
Posts: n/a
Default Xboard interface

Filipe Maia wrote in message ...
On Tue, 6 Jan 2004 11:52:07 -0800, John Vinyard
wrote:
endl;
cout.flush()
ladiest
If someone could help me out I'd really appreciate it. Even something
like
a "record" of the transactions between xboard and a "normal" program
would
be greatly appreciated.



xboard has a -debug flag.
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chessboard interface to be integrated in php or html pages Michel rec.games.chess.computer (Computer Chess) 1 December 17th 03 08:48 AM
Xboard and themes, a no-go Martin Andersen rec.games.chess.computer (Computer Chess) 0 December 5th 03 12:52 AM
XBoard and WinBoard, version 4.2.7 Tim Mann rec.games.chess.computer (Computer Chess) 0 November 28th 03 11:28 PM
Configuring windows on Chessbase interface RocketMan rec.games.chess.computer (Computer Chess) 1 November 14th 03 07:37 PM
Chesboard interface to be integrated in my php pages (Windows) Michel rec.games.chess.computer (Computer Chess) 0 November 11th 03 11:50 AM


All times are GMT +1. The time now is 02:32 PM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright ©2004-2019 ChessBanter.
The comments are property of their posters.
 

About Us

"It's about Chess"

 

Copyright © 2017