Need FEN or EPD in which King is in check

Code, algorithms, languages, construction...
Post Reply
vixen
Posts: 12
Joined: Fri Jun 11, 2010 4:39 pm
Real Name: Vikram

Need FEN or EPD in which King is in check

Post by vixen » Thu Nov 21, 2013 8:40 am

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

User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

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

Post by User923005 » Thu Nov 21, 2013 8:46 pm

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 -

hyatt
Posts: 1242
Joined: Thu Jun 10, 2010 2:13 am
Real Name: Bob Hyatt (Robert M. Hyatt)
Location: University of Alabama at Birmingham
Contact:

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

Post by hyatt » Thu Nov 21, 2013 8:59 pm

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

vixen
Posts: 12
Joined: Fri Jun 11, 2010 4:39 pm
Real Name: Vikram

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

Post by vixen » Fri Nov 22, 2013 7:01 am

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

hyatt
Posts: 1242
Joined: Thu Jun 10, 2010 2:13 am
Real Name: Bob Hyatt (Robert M. Hyatt)
Location: University of Alabama at Birmingham
Contact:

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

Post by hyatt » Fri Nov 22, 2013 5:34 pm

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.

Post Reply