Newer
Older
Algolike / src / main / java / controls / ConstantMethods.java
package controls;

import resources.Algo;

public class ConstantMethods {
    public static void printAlgoState(Algo algo) {
        String s = "";
        s += "deck:\n";
        for (var i : algo.getDeck()) {
            s += "\t" + i.getKey() + "\t" + (i.getValue() ? "open" : "closed") + "\n";
        }
        s += "handsA:\n";
        for (var i : algo.getHandsA()) {
            s += "\t" + i.getKey() + "\t" + (i.getValue() ? "open" : "closed") + "\n";
        }
        s += "handsB:\n";
        for (var i : algo.getHandsB()) {
            s += "\t" + i.getKey() + "\t" + (i.getValue() ? "open" : "closed") + "\n";
        }
        s += "\n";
        if (algo.getLoseA()) s += "B win.\n";
        else if (algo.getLoseB()) s += "A win.\n";
        System.out.println(s);
    }
}