A Chess forum. ChessBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ChessBanter forum » Chess Newsgroups » rec.games.chess.computer (Computer Chess)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Tags: ,

Xboard interface



 
 
Thread Tools Display Modes
  #1  
Old January 6th 04, 07:52 PM
John Vinyard
external usenet poster
 
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



Ads
  #2  
Old January 7th 04, 07:07 AM
Werner Mühlpfordt
external usenet poster
 
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  
Old January 7th 04, 04:36 PM
Peter Sch?fer
external usenet poster
 
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  
Old January 7th 04, 05:00 PM
John Vinyard
external usenet poster
 
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  
Old January 7th 04, 05:25 PM
Thomas T. Veldhouse
external usenet poster
 
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  
Old January 7th 04, 07:14 PM
Noah Roberts
external usenet poster
 
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  
Old January 8th 04, 02:25 AM
Filipe Maia
external usenet poster
 
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  
Old January 8th 04, 07:35 AM
Alexander Belov
external usenet poster
 
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  
Old January 9th 04, 05:53 PM
GymRat
external usenet poster
 
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.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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 11:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Content Relevant URLs by vBSEO 2.4.0
Copyright ©2004-2008 ChessBanter, part of the NewsgroupBanter project.
The comments are property of their posters.
RWG - Loans - Free Advertising - Debt - Free Credit Score