Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 826 Bytes

README.md

File metadata and controls

31 lines (23 loc) · 826 Bytes

tren

Optimal Mexican train builder using the A* search algorithm.

Usage

import tren.TrainBuilder;

public class Example {

    public static void main(String[] args) {
        // Use a pre-configured builder to minimize the number of remaining pips.  
        // Use TrainBuilder.byRemainingSize() to minimize the number of remaining dominos.
        var state = TrainBuilder.byRemainingValue()
                .setSeed(12)
                .addDomino(1, 2)
                ...
                .build();
        System.out.println(state.train());
        System.out.println(state.remaining());
        System.out.println(state.trainValue());
        System.out.println(state.trainSize());
        System.out.println(state.remainingValue());
        System.out.println(state.remainingSize());
    }
    
}