def check_split(rule):
cts = {cliff: 0 for cliff in Cliff}
for z in zoombinis:
- cts[Instance.assign(z, rule)] += 1
+ cts[assign(z, rule)] += 1
return all(v == 8 for v in cts.values())
self.cand_rules = frozenset(
if check_split(rule)
)
- @staticmethod
- def assign(zoombini, rule):
- (cliff, attrs) = rule
- return cliff if zoombini.attrs & attrs else cliff.other()
-
def filtered_rules(self, rules, across):
def check(rule):
(cliff, attrs) = rule
def cliff_scores(self, z):
cts = {cliff: 0 for cliff in Cliff}
for rule in self.cand_rules:
- cts[Instance.assign(z, rule)] += 1
+ cts[assign(z, rule)] += 1
return cts
def next_pair(self):