Atelier des rouesLab FR
Objects/Documentation

sejours25.py

Two ticks of dwell, including the endpoints · sejours25.py

Download ↓
"""Minimum two-tick dwell, including both endpoints, for adversarial misses."""
from itertools import combinations,product
from math import comb
import json

def paths(d,k):
    results={}
    for changes in range(k+1):
        for cc in combinations(range(2,23),changes):
            edges=(0,*cc,24)
            if min(b-a for a,b in zip(edges,edges[1:]))<2:continue
            for shifts in product((-1,0,1),repeat=changes+1):
                if any(u==v for u,v in zip(shifts,shifts[1:])):continue
                mask=sum(1<<t for a,b,e in zip(edges,edges[1:],shifts) for t in range(a,b) if (t-d-e)%6==5)
                results.setdefault(mask,(cc,shifts))
    return results

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.