Find Chess960 starting position identifier: Difference between revisions
Content deleted Content added
Line 599: | Line 599: | ||
} |
} |
||
⚫ | |||
List<Integer> rookAndKing = |
|||
⚫ | |||
⚫ | |||
⚫ | |||
throw new AssertionError("The king must be between the two rooks."); |
throw new AssertionError("The king must be between the two rooks."); |
||
} |
} |
||
Line 622: | Line 621: | ||
private static String retainIf(String aText, Predicate<Character> aPredicate) { |
private static String retainIf(String aText, Predicate<Character> aPredicate) { |
||
return aText.chars( |
return aText.chars() |
||
.mapToObj( i -> (char) i ) |
|||
⚫ | |||
.filter(aPredicate) |
|||
.map(String::valueOf) |
|||
⚫ | |||
} |
} |
||