How to send the FEN position to UCI engine?

You can discuss all aspects of programming and technical matters here.

Moderators: Harvey Williamson, Watchman

Post Reply
Albitex
Member
Posts: 32
Joined: Wed Dec 26, 2007 10:32 pm

How to send the FEN position to UCI engine?

Post by Albitex »

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)
Albitex
Member
Posts: 32
Joined: Wed Dec 26, 2007 10:32 pm

Post by Albitex »

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

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' ". :(
If they update these pages..
IanO
Member
Posts: 162
Joined: Sat Aug 15, 2009 11:43 pm
Location: Portland, OR

Post by IanO »

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.)
Post Reply