Atelier des rouesLab FR
Objects/Documentation

experience.py

Runnable starter-kit experiment with an enumeration check.

Download ↓
"""Count and select integer ticks in two periodic masks, including shared factors."""
from bisect import bisect_left
from collections import defaultdict
from math import gcd, lcm
from random import Random
import json


class Calendar:
    def __init__(self, m, left, n, right):
        if m < 1 or n < 1:
            raise ValueError("positive periods required")
        g = gcd(m, n)
        self.m = m
        self.period = lcm(m, n)
        self.span = n // g

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.