More fun with arrays


Here’s a recent array question from the mailing list: How do you build an array that looks like this?

[0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, ...] ?

I didn’t check the other answers yet, because that would be cheating 😉

When I look at that array, I see a repeating sequence of four integers, so that naturally suggests doing something with the Modulo node.

Arrays_0011_modulo

Using the If node is nice for clarity, but I could simply take the Boolean output of the comparison node.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s