Objects/Documentation
mots25.py
Testing a delivery-word rule · mots25.py
Download ↓"""A delivery-word rule frozen on four outputs, tested on a held-out fifth output."""
from collections import Counter
from itertools import permutations,product,groupby
import json
from motifs21 import solve
from quatre24 import oracle
def predict(motif,word,require_switch=True):
if word[-1]!='X':return False
prefix=word[:-1].lstrip('X')
if require_switch and (len(prefix)<2 or prefix[-1]==prefix[-2]):return False
runs=''.join(k for k,_ in groupby(prefix))
return runs in ('AB','BA') or (motif==1 and runs=='BAB')
def study():
outcomes=[]