That's definitely a newline character. You might eyeball your code to make sure you ignore it. I use strtok() myself, which handles that easily.Evert wrote:You know, that is a good point. If there is an extra character, the string would not match the move string and the move would be rejected.bob wrote: What is that character following the O-O? (012) In C that would be octal making it a 0x'0a' or "\n".
That's the normal unix end of line character (where windows likes a CR/LF pair to end the line.) That is normally removed during input parsing, but since it is showing that each time it mentions the O-O move, that looks wrong.
Question is how the extra character would get there. I use fgets to get the string (or readline when reading from a terminal) and then trim whitespace and newline from the end of the string...
Question about Sjaak
Moderator: Ras
-
bob
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Question about Sjaak
-
Michel
- Posts: 2292
- Joined: Mon Sep 29, 2008 1:50 am
Re: Question about Sjaak
I am now running it with -log. It's writing a log file.
But as you say since sjaak does not record the fen it will not be obvious how to draw conclusions from it.
But as you say since sjaak does not record the fen it will not be obvious how to draw conclusions from it.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
Without ideas there is nothing to simplify.
-
Evert
- Posts: 2929
- Joined: Sat Jan 22, 2011 12:42 am
- Location: NL
Re: Question about Sjaak
Well, two things I had in mind: seeing exactly what string it receives (if that would be the issue), and being able to replay the exact sequence of commands from "new" to the error.
-
Michel
- Posts: 2292
- Joined: Mon Sep 29, 2008 1:50 am
Re: Question about Sjaak
It appears that there are at least some bugs in the version of sjaakii I am using:
DISCLAIMER: I modified the source of sjaakii so as not to use __builtin_popcount (which segfaulted on me). So there is also the possibility that the substitute popcount you provide has a bug (or that I messed up modifying the source...).
DISCLAIMER: I modified the source of sjaakii so as not to use __builtin_popcount (which segfaulted on me). So there is also the possibility that the substitute popcount you provide has a bug (or that I messed up modifying the source...).
Reading config file '/home/vdbergh/.config/sjaakii.conf'
< xboard
>
< protover 2
> feature setboard=1 time=1 sigint=0 colors=0 highlight=1 ping=1 memory=1 analyze=1 pause=1 nps=1 myname="Sjaak II 1.3.0" myversion="[1.3.0 (x86_64)]" variants="seirawan,shatar,makruk,shatranj,sittuyin,crazyhouse,chessgi,asean,ai-wok,super,spartan,pocketknight,kingofthehill,knightmate,berolina,losalamos,micro,capablanca,gothic,embassy,greatshatranj,courier,grand,opulent,omega,minishogi,shoshogi,shogi,torishogi,xiangqi,chess960,fischerandom,fischerrandom,nocastle,wildcastle,great,caparandom,minisho,5x5+5_shogi,tori,7x7+6_shogi,sho,9x9+0_shogi,king-of-the-hill,fairy,8x8+0_fairy,8x8+6_fairy,8x8+1_fairy,6x6+0_fairy,5x5+0_fairy,10x8+0_fairy,12x8+0_fairy,10x10+0_fairy,12x12+0_fairy,5x5+5_fairy,9x9+0_fairy,9x9+8_fairy,7x7+6_fairy,9x10+0_fairy,normal"
> feature option="Variant fairy selects -combo chess (8x8+0) /// seirawan (8x8+0) /// shatar (8x8+0) /// makruk (8x8+0) /// shatranj (8x8+0) /// sittuyin (8x8+6) /// crazyhouse (8x8+6) /// chessgi (8x8+6) /// asean (8x8+0) /// ai-wok (8x8+0) /// super (8x8+0) /// spartan (8x8+0) /// pocketknight (8x8+1) /// kingofthehill (8x8+0) /// knightmate (8x8+0) /// berolina (8x8+0) /// losalamos (6x6+0) /// micro (5x5+0) /// capablanca (10x8+0) /// gothic (10x8+0) /// embassy (10x8+0) /// greatshatranj (10x8+0) /// courier (12x8+0) /// grand (10x10+0) /// opulent (10x10+0) /// omega (12x12+0) /// minishogi (5x5+5) /// shoshogi (9x9+0) /// shogi (9x9+8) /// torishogi (7x7+6) /// xiangqi (9x10+0) /// chess960 (= chess) /// fischerandom (= chess) /// fischerrandom (= chess) /// nocastle (= chess) /// wildcastle (= chess) /// great (= greatshatranj) /// caparandom (= capablanca) /// minisho (= minishogi) /// 5x5+5_shogi (= minishogi) /// tori (= torishogi) /// 7x7+6_shogi (= torishogi) /// sho (= shoshogi) /// 9x9+0_shogi (= shoshogi) /// king-of-the-hill (= kingofthehill)"
> feature option="Mate search -combo Disabled /// *Enabled for drop games /// Enabled"
> feature option="Draw offer threshold -spin 0 0 1000"
> feature option="Moves before draw offer (0 to disable) -spin 0 0 1000"
> feature option="Resign threshold -spin 500 100 16000"
> feature option="Moves before resigning (0 to disable) -spin 0 0 1000"
> feature option="Randomise opening moves -spin 10 0 40"
> feature option="Random amplitude (0 to disable) -spin 20 0 100"
> feature option="Send 'piece' descriptions -check 1"
> feature option="Mark holes in board -check 1"
> feature option="List user-defined variants before buildin variants -check 1"
> feature option="Report fail low -check 0"
> feature option="Report fail high -check 0"
> feature option="Claim repetitions -check 1"
> feature option="Send O-O/O-O-O for castling -check 1"
> feature option="Variant 'normal' is -string chess"
> feature option="Set variant alias -string "
> feature option="Variant configuration file -file "
> feature done=1
< post
< easy
< force
< ping 37
> pong 37
< hard
< easy
< random
< name lundin
< rating 1736 1637
< level 0 2 12
< variant normal
> # New game 'Chess'
< force
< Nf3
< Nf6
< d4
< e6
< Bg5
< c5
< c3
< h6
< Bxf6
< Qxf6
< e3
< d5
< Bb5+
Report illegal move Bb5+ in position:
> Error (Illegal move or unknown command): Bb5+
In position 'rnb1kb1r/pp3pp1/4pq1p/2pp4/3P4/2P1PN2/PP3PPP/RN1QKB1R w KQkq d6 0 7'
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
Without ideas there is nothing to simplify.
-
mar
- Posts: 2674
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Re: Question about Sjaak
Actually, that's the answer, fgets includes eol.Evert wrote:Question is how the extra character would get there.
-
hgm
- Posts: 28461
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Question about Sjaak
Doesn't it simply choke on the '+' here. (Illegal promotion; Bishops do not promote to Dragon Horse in variant normal...)Michel wrote:...
< d5
< Bb5+
Report illegal move Bb5+ in position:
> Error (Illegal move or unknown command): Bb5+
In position 'rnb1kb1r/pp3pp1/4pq1p/2pp4/3P4/2P1PN2/PP3PPP/RN1QKB1R w KQkq d6 0 7'
You seem to be sending SAN, which seems a protocol violation in itself. Or is it just that Sjaak converts the input move to SAN before logging it? (It would be strange if it would recognize the move as a check when it doesn't consider it legal, however.)
-
Evert
- Posts: 2929
- Joined: Sat Jan 22, 2011 12:42 am
- Location: NL
Re: Question about Sjaak
That should be easy enough to test: SjaakII has a "test movegen" command that verifies that the move generation works correctly using a number of test positions across different variants.Michel wrote:It appears that there are at least some bugs in the version of sjaakii I am using:
DISCLAIMER: I modified the source of sjaakii so as not to use __builtin_popcount (which segfaulted on me). So there is also the possibility that the substitute popcount you provide has a bug (or that I messed up modifying the source...).
-
Michel
- Posts: 2292
- Joined: Mon Sep 29, 2008 1:50 am
Re: Question about Sjaak
Yes that's it! Although I do not see the connection with promotion. An appended + is legal in SAN no?Doesn't it simply choke on the '+' here. (Illegal promotion; Bishops do not promote to Dragon Horse in variant normal...)
You seem to be sending SAN, which seems a protocol violation in itself.
I agree. It seems sjaak is indeed not to blame. It does not advertize that it understands SAN so it is not required to parse it....
A problem with icsdrone is that it has no chess knowledge. So it has to rely on the ics for move lists. Unfortunately ICC only seems to provide move lists in SAN (I would be glad to learn otherwise). Currently icsdrone assumes by default that the engine understands SAN. There is an option to turn that off but then it cannot use move lists, with the usual caveats for adjourned games (this is a minor issue really).
I have a question: what is the reference for a crazyhouse FEN?
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
Without ideas there is nothing to simplify.
-
Evert
- Posts: 2929
- Joined: Sat Jan 22, 2011 12:42 am
- Location: NL
Re: Question about Sjaak
Yes, but I chop it off. The only thing I can think of is that there are two of them and I only chop off the last one, rather than the first one. Seems unlikely as I would normally use strstr to look for "\n", but I have to check the source.mar wrote:Actually, that's the answer, fgets includes eol.Evert wrote:Question is how the extra character would get there.
-
Michel
- Posts: 2292
- Joined: Mon Sep 29, 2008 1:50 am
Re: Question about Sjaak
Ok I did this. The test passes.Evert wrote:That should be easy enough to test: SjaakII has a "test movegen" command that verifies that the move generation works correctly using a number of test positions across different variants.Michel wrote:It appears that there are at least some bugs in the version of sjaakii I am using:
DISCLAIMER: I modified the source of sjaakii so as not to use __builtin_popcount (which segfaulted on me). So there is also the possibility that the substitute popcount you provide has a bug (or that I messed up modifying the source...).
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
Without ideas there is nothing to simplify.