for loop questions
in
Programming Questions
•
1 year ago
I have a question or two about for loops. Why does this example not use brackets? It works with for loop brackets I noticed.
int
w=256,r=16,i,t;
void
draw
(){
for
(i=0;i<w*w;i++)
set
(i%w,i/w,2*
noise
(i%w/r,i/w/r)>1?-1:-w<<(
dist
(
mouseX
/r,
mouseY
/r,i%w/r,i/w/r)<3?0:r));
- }
Also is it possible to combine values in for loops to say something like
for(i = 0 && j = 0;i<width && j<height;i++ && j++){
}
instead of writing them separately. I'm guessing not.
for(i = 0 && j = 0;i<width && j<height;i++ && j++){
}
instead of writing them separately. I'm guessing not.
1