Trouble with using a data set to inform what happens to a geometry

Hi, very new to grasshopper. I have designed an algorithm that is meant to create a 2D pattern/image; the final product is less important than the algorithm itself. I have generated a random list of 200 integers with a range of 0-100. I’m trying to create a script that will evaluate each integer and test for if it’s even or odd, and then move and/or scale a polygon based on these parameters, but I’m not sure how translate the data set I have into a true/false value that I can connect to some component that will then inform how the curve acts. I’m also doing different movements based on if each number in the set is greater than a certain value. I’m also trying to use the Hoopsnake plugin to do this and create a loop that runs 200 times. Any feedback or tips is appreciated; Grasshopper is a foreign language to me at this point.

Algorithms (19.7 KB)

1 Like

I am away from my workstation right now, but you can use the modulus component to evaluate if a value is even or odd (out putting 0 or 1). You can then use that boolean pattern to sort/dispatch your list. example here, (if I have understood your question correctly).

You can use Python to separate odd and even numbers and get True/False values.

Algorithms (18.9 KB)

While I am all for using the ghpython component to solve problems, (that can’t be solved with native GH components),…that seems like overkill for someone who stated…:

I use Python sometimes to avoid using many components especially for Math, and solution like that is available to anyone without expert knowledge in python.
The problem here isn’t about finding odd and even numbers; the script already can do this.
With native component we can use Larger than component to get True/False

From your Diagram i think you want something like that


Algorithms (33.4 KB)

1 Like