Infinite and countdown counters
public interface IInfiniteCounter : IEnumerable&lt;(int Value, InfiniteCounterState State)&gt;



vs


    int Current { get; }

    (int Value, InfiniteCounterState State) Next();

    void Reset();



The interface itself looks a lot more like IEnumerator&lt;&gt; than IEnumerable&lt;&gt;, so IMO implementing IEnumerable&lt;&gt; is misleading and dangerous. The docs for IEnumerable&lt;&gt; don't say either way whether or not it's possible to have two active enumerators at the same time, but I can't think of any implementations in the standard library for which it isn't possible, and I've probably written a lot of code which assumes that it is possible.




    int Min { get; }

    int Max { get; }

    int Length { get; }



I can safely assume that Min is inclusive, but I absolutely need a comment to tell me whether Max is or not, and it would be helpful to have a comment indicating the standard implementation of Length. Also, should Length be uint both because it's guaranteed to be non-negative and to avoid overflow in edge cases?




public static class IndexMath
{
    public static int Flip(this int value, int min, int max)
    {
        return (-(value - max + 1) % (max - min)) + min;
    }
}



I don't understand why this method uses %. For me the obvious interpretation of the name (and the use case) is max - (value - min). If there's some trickery going on to avoid or handle overflow, it needs explanatory comments.