Ras wrote: ↑Mon Feb 24, 2020 6:24 pm
I'm using this:
Code: Select all
if ((wkings != 1) || (bkings != 1)) return(POS_NO_KING);
if ((wpieces > 16) || (bpieces > 16)) return(POS_TOO_MANY_PIECES);
if ((wpawns > 8) || (bpawns > 8)) return(POS_TOO_MANY_PAWNS);
promoted_pieces = 0;
if (wqueens > 1) promoted_pieces += wqueens - 1;
if (wrooks > 2) promoted_pieces += wrooks - 2;
if (wbishops > 2) promoted_pieces += wbishops - 2;
if (wknights > 2) promoted_pieces += wknights - 2;
if (promoted_pieces > 8 - wpawns) return(POS_OVERPROM);
promoted_pieces = 0;
if (bqueens > 1) promoted_pieces += bqueens - 1;
if (brooks > 2) promoted_pieces += brooks - 2;
if (bbishops > 2) promoted_pieces += bbishops - 2;
if (bknights > 2) promoted_pieces += bknights - 2;
if (promoted_pieces > 8 - bpawns) return(POS_OVERPROM);
Cool. Looks like solved.
I had one more thought. If a pawn is not opposed (ie there is no enemy pawn in front of it on same file) there has to be at least one piece already removed. One piece for every unopposed pawn.
Unfortunately could be either sides piece for any particular pawn, Also true for any fully open files (I think they require two captures).
For example my EPD in the first post with 16 passed pawns is actually impossible.
Overkill, though, I guess.
Although the thought did arise, if one could eliminate many impossible positions, say in.a random suite of many random artificial created positions, then we could have a stab at the approximate number of actual total possible positions.
Then quite a few if those could be knocked out on basis too much material imbalance. AnywAy, it drops the upper bound.
Then, my imagination is running away, we train a neural net on some sample of actual real game positions, against what we know are outside the rules of chess, and use that net on another set of randomly created positions and ask it, real or artificial?
Final stab at estimating count of actual real total positions.