Interval generator

I made this interval generator.


Documentation on each input slot:

  • Slot 1: either one of the preset values or a 2 item list of booleans.
    Represents the inclusives (start, end) of the interval. The options on the input slot are:
    Range ( start: end: )
    Segment ( start: end: )
    Chain ( start: end: )
    Tube ( start: end: )
Note about 'chain' and 'tube'

These aren’t official terms, I made them myself.

  • Slot 2: The start of the interval. A number
  • Slot 3: The end of the interval. A number
  • Slot 4: The step (between each number in the interval). A number
  • Slot 5: The order rules.
    • Ascending makes it report an empty list if start > end.
    • Descending reports an empty list if the start < end.
    • Implicit changes it based on which of the start and end is greater.
    • From step makes it based on the signnum() of the step (e.g, step of 1 is ascending but -1 is descending).
    • Swap to ascending makes it reverse the list if start > end
    • Swap to descending makes it reverse the list’s items if start < end
    • Swap from step makes it swap if the step is incompatible with the start/end.

In what context are “range” and “segment” official names? (I gather they must be because you say “chain” and “tube” aren’t.)

How I learned it is that the interval not including its endpoints is called open and is denoted (a,b). The interval including its endpoints is called closed and is denoted [a,b]. (These notations are more relevant to intervals of real numbers than to integers, since in integers (1,10) is the same as [2,9].) I’ve seen “semi-open” for both [a,b) and (a,b] but both are uncommon.

I use inclusive for [a, b], exclusive for (a, b), inclusive-exclusive for [a, b), and exclusive-inclusive for (a, b]

Python. And segment can also mean any interval but in this context means all inclusive.

set (ex) to (pick random (1) to (10))
run (pick random (ex) to (10))

Is this useful

No

sorry