newbie question: 2 dimensional loop iteration

Jan 28, 2012 at 8:42pm

newbie question: 2 dimensional loop iteration

Hello,
I’m just starting with Max and am having trouble doing a 2 dimensional iteration. What I want to accomplish in Max is this code:
for(i = 0; i < 8; i++){
for(j = 0; j < 8; j++){
print ( i , j )
}
}

I have a sketch of it in Max using “uzi” and “counter” but it is skipping some values. What am I doing wrong?
Cheers,

mrbook

– Pasted Max Patch, click to expand. –
#61509
Jan 28, 2012 at 9:56pm

You’re close :)

– Pasted Max Patch, click to expand. –
#221919
Jan 28, 2012 at 9:57pm

… and uhm, there might be much simpler ways of doing this, but I be tired and can’t think straight. :)

#221920
Jan 28, 2012 at 10:38pm

maybe this?

– Pasted Max Patch, click to expand. –
#221921
Jan 28, 2012 at 10:43pm

hehe, see? yeah, [uzi] is pretty much made for this for( loop thing precisely because of that rightmost outlet.

#221922
Jan 29, 2012 at 2:18am

Great, thank you guys for the answers..

#221923

You must be logged in to reply to this topic.