![]() |
| 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. |
|
|||||||
| Tags: interface, xboard |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
"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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
"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
|
|||
|
|||
|
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 | |
|
|
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 |