Atelier des rouesLaboratoire EN
Objets/Documentation

sauts18.py

Sauter des retournements · Programme Python reproductible.

Télécharger ↓
"""Random access and the exact sequential work bypassed in the suffix-flip order."""
import json
from math import factorial
from pathlib import Path
import sys

if not (Path(__file__).parent / "roues.py").exists():
    sys.path.insert(0,str(Path(__file__).resolve().parents[2]/"diffusion/I/src"))
from roues import unrank_fast, unrank, flip_length


def run(start, distance, n=9):
    if n<2 or not 0<=start<factorial(n) or distance<0:
        raise ValueError("invalid rank or distance")
    end=start+distance
    counts={}

Lire dans son contexte

Commentaires

Les commentaires en français et en anglais sont réunis ici.

La discussion reste consultable. J’ouvrirai les participations dès que la protection antispam sera configurée.