-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkpk.h
48 lines (40 loc) · 1.74 KB
/
kpk.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*----------------------------------------------------------------------+
| |
| kpk.h -- pretty fast KPK endgame table generator |
| |
+----------------------------------------------------------------------*/
/*
* Use an externally defined board geometry to avoid conversions
* from the caller's own square indexing. All 8 orientations are
* supported by changing this header file. As a demonstration of
* this, geometry-h8g8.h is provided.
*/
#include "geometry-a1a2.h"
/*----------------------------------------------------------------------+
| Functions |
+----------------------------------------------------------------------*/
/*
* Probe a KPK position from the in memory endgame table.
* Returns 0 for draw, 1 for win and -1 for loss.
*
* The position must be legal for meaningful results.
* `side' is 0 for white to move and 1 for black to move.
*
* If the table has not been generated yet, this will be
* done automatically at the first invocation.
*/
int kpkProbe(int side, int wKing, int wPawn, int bKing);
/*
* Explicitly generate the KPK table.
* Returns the memory size for info.
* This can take up to 2 milliseconds on a 2.6GHz Intel i7.
*/
int kpkGenerate(void);
/*
* Perform a self check on the bitbase.
* Returns 0 on failure, 1 for success.
*/
int kpkSelfCheck(void);
/*----------------------------------------------------------------------+
| |
+----------------------------------------------------------------------*/