package simulator;


/*
  Rules for MU wheel settings:

  1) MU1 (61 pins)
    30 <= k <= 50, k != 37 [k = crosses]
    <=5 consecutive dots
    <=15 consecutive crosses

  2) MU2 (37 pins)
    14 <= d <= 28, [d = dots]
    <=5 consecutive dots
    <=6 consecutive crosses

   */
public class MuRule {

    public static final int MU1_MAX_CONSECUTIVE_DOTS = 5;
    public static final int MU1_MAX_CONSECUTIVE_CROSSES = 15;
    public static int mu1RandomCrosses() {
        int crosses;
        do {
            crosses = Utils.random(MU1_MIN_CROSSES, MU1_MAX_CROSSES);
        } while (crosses == MU1_INVALID_CROSSES);
        return crosses;
    }
    public static final int MU2_MAX_CONSECUTIVE_DOTS = 5;
    public static final int MU2_MAX_CONSECUTIVE_CROSSES = 6;
    public static int mu2RandomDots() {
        return Utils.random(MU2_MIN_DOTS, MU2_MAX_DOTS);
    }

    // Private
    private static final int MU1_MIN_CROSSES = 30;
    private static final int MU1_MAX_CROSSES = 50;
    private static final int MU1_INVALID_CROSSES = 37; // cannot have exactly 37 crosses

    private static final int MU2_MIN_DOTS = 14;
    private static final int MU2_MAX_DOTS = 28;

}
