Exemplo n.º 1
0
  public boolean isInLang(String s) {
    char[] list = new char[] {'a', 'b'};
    if (LemmaMath.otherCharactersFound(s, list)) return false;
    if (!s.startsWith("bbbbb")) return false;

    int a, b;
    String temp = s.substring(5);
    a = LemmaMath.countInstances(temp, 'a');
    b = LemmaMath.countInstances(temp, 'b');
    if (2 * a == 3 * b) return true;
    return false;
  }
Exemplo n.º 2
0
 public void chooseI() {
   i = LemmaMath.flipCoin();
 }