#Share: Iterating from an initial value, returning list of iterated results

Faced a challenge and thought I would post the results, assuming it might be useful to the larger community.

Faced with variable subtractions, list lengths and initial values, I came up with the following. This could be used to calculate differences in geometry along a length.

If nothing else, it’s a good learning exercise as it involves Imperative code, a While Loop, and Design Script. Hopefully my comments in the code block make sense.

4 Likes

What surprises me is that you declare y as an integer but change the type into an array during the calculation. It seems to work though.