public RuleSet(String rule) throws IllegalArgumentException {
        if (!rule.matches("[0-8]{0,9}/[0-8]{0,9}")) {
            throw new IllegalArgumentException("Bad RuleSet string format.");
        }

        this.rule = rule;
        String survive = rule.substring(0, rule.indexOf("/"));
        String born = rule.substring(rule.indexOf("/") + 1);
        for (int i = 0; i < survive.length(); i++) {
            this.survive[i] = Integer.parseInt(survive.substring(i, i + 1));
        }

        for (int i = 0; i < born.length(); i++) {
            this.born[i] = Integer.parseInt(born.substring(i, i + 1));
        }
    }