|  | |  |
|
Using
the endgame tablebase:
Returns
the score of the given position. The input is the position in FEN
notation. A description of FEN can be found at Wikipedia.
The score is given as distance to mat, or 0 when the position
is
a draw. An error response is returned when position is invalid or
not
in database. e.g. M5 = color to move gives mate in 5 , -M3 =
color to move gets mated in 5 moves. Given
a FEN position as input, the return is a list of all the valid moves
together with their scores.
For
Example:
FEN: 8/8/8/8/6p1/7p/4kB2/6K1
b - -
returns: Ke1-d1
0 Ke2-d2 0 h3-h2
M17 Ke2-d3 0 Ke2-f3
0 g4-g3 0
An example in using FEN notation:
Here's
the FEN for the starting
position: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR
w KQkq - 0 1
And
after the move 1. e4: rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR
b KQkq e3 0 1
And
then after 1. ... c5: rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR
w KQkq c6 0 2
And
then after 2. Nf3: rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R
b KQkq - 1 2
For
two kings on their home
squares and a white pawn on e2 (White to move) with thirty eight
full
moves played with five halfmoves since the last pawn move or capture: 4k3/8/8/8/8/8/4P3/4K3
w - - 5
39 |
|
|