HIARCS Chess Forums Forum Index HIARCS Chess Forums
World Championship winning computer chess software program & downloads for chess database, analysis and play on PC, Mac and iPhone
 
 QuestionsQuestions   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Private MessagesPrivate Messages   Log inLog in 

How to send the FEN position to UCI engine?

 
Post new topic   Reply to topic    HIARCS Chess Forums Forum Index -> Programming Discussions
View previous topic :: View next topic  
Author
Albitex
Member


Joined: 26 Dec 2007
Posts: 32

PostPosted: Sun Apr 24, 2011 1:32 am    Post subject: How to send the FEN position to UCI engine? Reply with quote

In console mode, I can't send the string FEN, (display the position) to Rybka.
I write: position fen 8/5p2/4k1p1/6Rp/3K3P/5rP1/8/8 b - - 0 1\n
But it says (write in console): "info string: invalid fen string".
How do I write the string fen? (Rybka or every other uci engine)
Back to top
View user's profile Send private message Send e-mail
Albitex
Member


Joined: 26 Dec 2007
Posts: 32

PostPosted: Sun Apr 24, 2011 3:07 am    Post subject: Reply with quote

I solved it by itself: I don't have to put "\n" in the end.
This happens to follow the guide online Mad

In Shredder page uci protocol, they write: "all command strings the engine receives will end with '\n', also all commands the GUI receives should end with '\n' ". Sad
If they update these pages..
Back to top
View user's profile Send private message Send e-mail
IanO
Member


Joined: 15 Aug 2009
Posts: 154
Full Name: Ian Osgood
Location: Portland, OR

PostPosted: Sun Apr 24, 2011 2:11 pm    Post subject: Reply with quote

The "\n" stands for newline in C-like languages. At a terminal, it simply means "press the Return key".

(Note for the unwary: different engines have different end of line expectations. It could be any of CR-LF, LF, or CR.)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    HIARCS Chess Forums Forum Index -> Programming Discussions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP