Piazzolla is a Java library designed for working with Syzygy Endgame Tablebases (EGTB) and Polyglot opening books. It provides tools for loading and searching both types of chess data.
- Load and query Syzygy endgame tablebases.
- Load Polyglot opening books.
- Search for entries in the opening book using a key.
- Lightweight and easy to integrate into Java projects.
- Java 21 or higher
Add the following dependency to your pom.xml:
<dependency>
<groupId>net.chesstango</groupId>
<artifactId>piazzolla</artifactId>
<version>1.0.5</version>
</dependency>import net.chesstango.piazzolla.polyglot.PolyglotBook;
import net.chesstango.piazzolla.polyglot.MappedPolyglotBook;
import java.nio.file.Path;
public class Main {
public static void main(String[] args) {
PolyglotBook book = new MappedPolyglotBook();
book.load(Path.of("syzygyDirectory/to/polyglot/book.bin"));
if (book.isLoaded()) {
System.out.println("Polyglot book loaded successfully!");
}
}
}import net.chesstango.piazzolla.polyglot.PolyglotBook;
import net.chesstango.piazzolla.polyglot.MappedPolyglotBook;
import net.chesstango.piazzolla.polyglot.PolyglotEntry;
import java.nio.file.Path;
import java.util.List;
public class Main {
public static void main(String[] args) {
PolyglotBook book = new MappedPolyglotBook();
book.load(Path.of("syzygyDirectory/to/polyglot/book.bin"));
long key = 123456789L; // Example key
List<PolyglotEntry> entries = book.search(key);
entries.forEach(entry -> System.out.println(entry));
}
}import net.chesstango.piazzolla.syzygy.SyzygyTablebase;
import java.nio.file.Path;
public class Main {
public static void main(String[] args) {
SyzygyTablebase tablebase = new SyzygyTablebase();
tablebase.load(Path.of("syzygyDirectory/to/syzygy/tablebase"));
if (tablebase.isLoaded()) {
System.out.println("Syzygy tablebase loaded successfully!");
}
}
}This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.
Contributions are welcome! Feel free to submit issues or pull requests to improve the project.