Skip to content

mcoria/piazzolla

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

113 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java CI with Maven

Piazzolla

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.

Features

  • 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.

Requirements

  • Java 21 or higher

Installation

Add the following dependency to your pom.xml:

<dependency>
    <groupId>net.chesstango</groupId>
    <artifactId>piazzolla</artifactId>
    <version>1.0.5</version>
</dependency>

Usage

Loading a Polyglot Book

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!");
        }
    }
}

Searching for Entries

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));
    }
}

Loading a Syzygy Tablebase

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!");
        }
    }
}

License

This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.

Contributing

Contributions are welcome! Feel free to submit issues or pull requests to improve the project.

About

Piazzolla is a Java library designed for working with Syzygy Endgame Tablebases (EGTB) and Polyglot opening books.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages