Page 1 of 1

Need FEN or EPD in which King is in check

Posted: Thu Nov 21, 2013 8:40 am
by vixen
I need an epd or frn in which king is in check
or any utility which which can extract same info from pgn files
Thanks

Re: Need FEN or EPD in which King is in check

Posted: Thu Nov 21, 2013 8:46 pm
by User923005
If you get Epd2diag or similar tool, you can easily generate them.
Here is an example:
rnb1k1nr/pp2ppbp/3p2p1/q1pP4/2P1P3/3B4/PP3PPP/RNBQK1NR w KQkq -

Re: Need FEN or EPD in which King is in check

Posted: Thu Nov 21, 2013 8:59 pm
by hyatt
vixen wrote:I need an epd or frn in which king is in check
or any utility which which can extract same info from pgn files
Thanks

How hard is this to do?

k7/1P6/1K6/8/8/8/8/8 b - - 0 1

Re: Need FEN or EPD in which King is in check

Posted: Fri Nov 22, 2013 7:01 am
by vixen
Actually i am writing engine in java (very much a beginners code) and one thing i found was that in certain cases i was failing to figure if king is in check
so just wanted to check my code against all those positions
i thought it would be good if already such fen exists or such utility exists
otherwise i can generate sch positions also (It would be good if i check against real positions)
Thanks

Re: Need FEN or EPD in which King is in check

Posted: Fri Nov 22, 2013 5:34 pm
by hyatt
You should look up perft. Implement that. Since it does not count illegal moves, correct "in check" detection is necessary. There are lots of positions posted on the internet with perft totals, or you could download Crafty to compare your perft count to what it produces. Crafty will print the tree if you find you don't get the same value, so that you can compare the moves to see where you incorrectly deal with check.