We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Im stumped, need help.
Page Index Toggle Pages: 1
Im stumped, need help. (Read 541 times)
Im stumped, need help.
May 2nd, 2006, 9:18pm
 
size (300,300);
smooth ();

for (int a = 0; a < 300; a= a+10){
for (int b= 0; b < 300; b = b+10){

line (a,0,b,300);
}}

I can't understand why this doesn't work.
I just wanted to draw vertical lines across
the screen but it becomes this crazy weird
image.

I slept on it and still am completely lost.
Sorry for being completely clueless, I'm
beginning (and enjoying) the learning process.
Re: Im stumped, need help.
Reply #1 - May 2nd, 2006, 9:57pm
 
I prefer yours to be honest, but here you go!

Code:


size (300,300);
smooth ();

for (int a = 0; a < 300; a= a+10) {

line (a,0,a,300);
}



p.s

Your code will have drawn 30 * 30 lines, because the outer loop will have only been re-tested, once the inner had been satisified. sorry, bit of a crap explanation.
There'll be plenty on the web and probably this forum covering nested conditionals
Re: Im stumped, need help.
Reply #2 - May 4th, 2006, 2:54am
 
Quote:
I prefer yours to be honest, but here you go!

Code:


size (300,300);
smooth ();

for (int a = 0; a < 300; a= a+10) {
 
 line (a,0,a,300);
}



p.s

Your code will have drawn 30 * 30 lines, because the outer loop will have only been re-tested, once the inner had been satisified. sorry, bit of a crap explanation.
There'll be plenty on the web and probably this forum covering nested conditionals


Thanks for the help!!
Page Index Toggle Pages: 1