Find Chess960 starting position identifier: Difference between revisions
Content deleted Content added
m Added language identifier. |
m Small improvement to coding. |
||
Line 574: | Line 574: | ||
for ( String position : positions ) { |
for ( String position : positions ) { |
||
validate( |
validate(position); |
||
System.out.println("Position " + position + " has Chess960 SP-ID = " + calculateSPID(position)); |
System.out.println("Position " + position + " has Chess960 SP-ID = " + calculateSPID(position)); |
||
} |
} |
||
Line 588: | Line 588: | ||
pieces.merge(ch, 1, (oldV, newV) -> oldV + 1); |
pieces.merge(ch, 1, (oldV, newV) -> oldV + 1); |
||
} |
} |
||
⚫ | |||
⚫ | |||
if ( ! pieces.entrySet().equals(correctPieces) ) { |
if ( ! pieces.entrySet().equals(correctPieces) ) { |
||
throw new AssertionError("Chess position contains incorrect pieces."); |
throw new AssertionError("Chess position contains incorrect pieces."); |
||
Line 643: | Line 642: | ||
private static Map<List<Integer>, Integer> knightsTable; |
private static Map<List<Integer>, Integer> knightsTable; |
||
⚫ | |||
⚫ | |||
} |
} |