Select from arrays

kyma's picture

I'm using iterator to create a short array of cubes. Now I want to select individual cubes from the array using the index and (for example) change its colour or shape properties. I have connected Iterator Variables/Iterations to the Structure index member and then I'm using a javascript if statement to test whether it is the same as the current iteration. My javascript is:

if ( inputs[0] == inputs[1]) {
   outputs[0]=6;
}else {
outputs[0] = 1;
};

But for some reason it is never true. Can anyone help with this simple problem?

PreviewAttachmentSize
SimpleArray.qtz3.59 KB

.lov.'s picture
why structure?

I think the problem is the using of the structure index patch.

www.lovqc.hu

PreviewAttachmentSize
SimpleArray.qtz3.69 KB

kyma's picture
Thanks

That's great, thanks a lot

.lov.'s picture
you are welcome

you are welcome :)