1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
= "sequence"
= "sequence.md"
# The number the sequence should start at
[[]]
= "start"
= "number"
# limit of the sequence - inclusive
[[]]
= "limit"
= "number"
# 'step' is the amount to add each time
[[]]
= "step"
= "number"
# The sequence of numbers we will generate
[[]]
= "number"
= "number"
# the last value is output when the sequence ends (may not be == limit if step is not 1)
[[]]
= "last"
= "number"
# compare_switch will pass all numbers that are less than the limit on the "right-lte" output
[[]]
= "lib://flowstdlib/control/compare_switch"
# For the first time around, pass the start number of the sequence into "compare_switch"
[[]]
= "input/start"
= "compare_switch/right"
= "first"
[[]]
= "input/limit"
= "compare_switch/left"
= "limit"
# connect the right-lte output of compare_switch to the output of this flow - the sequence of numbers being generated
[[]]
= "compare_switch/right-lte"
= "output/number"
# while the sequence is running - loopback the limit value to compare against next time
[[]]
= "compare_switch/left-gt"
= "compare_switch/left"
= "feedback-limit"
# An add process to add "step" to the last output of the sequence each time
[[]]
= "lib://flowstdlib/math/add"
[[]]
= "input/step"
= "add/i2"
= "step"
# Take generated number of the sequence and pass it to 'add' to add one to it for the next number in the sequence
[[]]
= "compare_switch/right-lt"
= "add/i1"
= "previous"
# Feedback step for next iteration
[[]]
= "add/i2"
= "add/i2"
= "feedback-step"
# Feed next value back to compare_switch for the next iteration
[[]]
= "add"
= "compare_switch/right"
= "feedback-value"
# When compare_switch determines the next value is the last (greater-than-or-equal to the limit) then
# output that value - whose presence indicates it's the end of the sequence
[[]]
= "compare_switch/right-gte"
= "output/last"