Permalink
Browse files

Add more constants in Tablebase; add private constructor with two

private members and respective getters
  • Loading branch information...
1 parent 024bcdb commit e8575757e384558744d0cbfec660bc9cbe808a80 Kestutis-Z committed Nov 5, 2012
@@ -10,11 +10,35 @@
*/
public enum Tablebase {
- KK,
+ KK(0, 0),
+ KRK(175168, 223944),
+ KPK(163328, 168024),
+ KRKR(10780728, 10780728),
+ KRKP(8100040, 9963008),
+ KRPK(7877172, 10249464),
+ KRPKR(476609388, 490095548)
- KRK,
+ // TODO all the remaining tablebases
- KRPKR;
+ ;
+
+ private final long totalWhiteToMovePositions;
+ private final long totalBlackToMovePositions;
+
+ private Tablebase(long wCount, long bCount) {
+ totalWhiteToMovePositions = wCount;
+ totalBlackToMovePositions = bCount;
+ }
+
+ /** @return number of white-to-move positions in tablebase */
+ public long getWhiteToMovePositionCount() {
+ return totalWhiteToMovePositions;
+ }
+
+ /** @return number of black-to-move positions in tablebase */
+ public long getBlackToMovePositionCount() {
+ return totalBlackToMovePositions;
+ }
/**
* @return number of pieces (White and Black) that
@@ -44,4 +68,5 @@ public int chessPiecesCount() {
? tablebaseName.substring(0, blackKingsIndex).toCharArray()
: tablebaseName.substring(blackKingsIndex).toCharArray();
}
+
}
@@ -40,4 +40,12 @@ public void testGetPiecesAsCharsFromTablebase() {
assertArrayEquals(expectedBlackPieces2, actualBlackPieces2);
}
+ @Test
+ public void testGetTablebasePositionCount() {
+ Tablebase tablebase1 = Tablebase.KRKR;
+ Tablebase tablebase2 = Tablebase.KPK;
+
+ long expectedPositionCountactualPositionCount;
+ }
+
}

0 comments on commit e857575

Please sign in to comment.