Skip to content

tolius/antichess-tb-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Antichess tablebase API

This is an API for reading data from the antichess endgame tablebase with DTW (Depth To Win) metric.

The API represents 3 functions:

  1. antichess_tb_init should be called once at the very beginning. If initialisation is successful, the function returns 0.
  2. antichess_tb_add_path should be called once before probing, specifying the path to the folder where all tablebase files are located. If all files are successfully loaded, the function returns 0.
  3. antichess_tb_probe_dtw is used for probing antichess positions:
  • white_squares/black_squares should have values from 0 (a1), 1 (b1), etc. to 63 (h8).
  • white_pieces/black_pieces should have values from 1 to 6 for PNBRQK (only the least significant three bits are taken into account).
  • num_white_pieces/num_black_pieces should be 1+1, 1+2, 1+3, 2+1, 2+2, or 3+1.
  • ep_square specifies the en passant target square (16...23 or 40...47) or any other value outside these ranges if there are none. In case of an error, the function returns a negative value indicating the error code. If one side wins, the function returns 0. In case of a cursed win or a blessed loss (because of the 50-move rule), the function returns 1. In case of a draw, the function returns 2. If there are no errors, the function sets the value of dtw. The absolute value of dtw is equal to the number of plies before the win. The value is positive if the side to move wins, or negative if the side to move loses. dtw = 0 if it is a draw or the side to move has no legal moves.

License

This code is released under the GPLv3+ license.

The following code is used in the program:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published