Just starting to learn processing in Uni. Was trying to compact some lines in to a 'for' statement.
These:
Code://Set background color and smooth lines
size(250,250);
smooth();
//Set stroke color to white and create strokes
line(245,0,245,250);
line(240,10,235,250);
line(235,20,225,250);
line(230,30,215,250);
line(225,40,205,250);
line(220,50,195,250);
line(215,60,185,250);
line(210,70,175,250);
line(205,80,165,250);
line(200,90,155,250);
line(195,100,145,250);
line(190,110,135,250);
line(185,120,125,250);
line(180,130,115,250);
line(175,140,105,250);
line(170,150,95,250);
line(165,160,85,250);
line(160,170,75,250);
Into this:
Code:size(250,250);
smooth();
for(int i = 245; i > 160; i -= 5){
for(int o = 0; o < 170; o += 10){
for(int p = 245; p > 75; p -= 10){
line(i, o, p, 250);
}
}
}
Prof couldn't help me out, hopefully you can, I just want to create the results of the first code using multiple 'for' statements that are applied to a 'line' statement.
If you preview the first lines of code you will see the outcome I am looking for.