1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-02 01:29:36 +00:00

fix marco's binomial patch

This commit is contained in:
lucasart 2016-04-18 18:23:14 +08:00 committed by Marco Costalba
parent 8c58963897
commit af0eb46fad

View file

@ -534,17 +534,19 @@ void Tablebases::init(const std::string& path)
binomial[k][n] = (k ? binomial[k-1][n-1] : 1) + binomial[k][n-1]; binomial[k][n] = (k ? binomial[k-1][n-1] : 1) + binomial[k][n-1];
} }
for (int s = 0, i = 0; i < 5; i++) for (int i = 0; i < 5; i++) {
{ int k = 0;
for (int j = 0; j < 24; j++)
{
pawnidx[i][j] = s;
s += (i ? binomial[i - 1][ptwist[invflap[j]]] : 1);
if (j && !(j % 6)) for (int j = 1; j <= 4; j++) {
pfactor[i][(j / 6) - 1] = s, s = 0; int s = 0;
for ( ; k < 6 * j; k++) {
pawnidx[i][k] = s;
s += (i == 0) ? 1 : binomial[i - 1][ptwist[invflap[k]]];
}
pfactor[i][j - 1] = s;
} }
pfactor[i][3] = s;
} }
// Argument path is set to the directory or directories where the .rtbw and // Argument path is set to the directory or directories where the .rtbw and