more lines, than there should are, array
in
Programming Questions
•
2 years ago
Hi there,
i would like to draw so many lines which quantity is given in an array.
In this example there should be only 3 lines, but processing is drawing more than 3 lines. I don't know why.
Perhaps you can help me? Any help would be appreciated.
Thanks a lot!
i would like to draw so many lines which quantity is given in an array.
In this example there should be only 3 lines, but processing is drawing more than 3 lines. I don't know why.
- int[][] daten = { {200,500,300}, // should be only 3 lines, 1 line for each column (number in {.,.,.,.})
{300,400,200},
{400, 450, 150},
{300, 500, 100},
};
int x;
void setup() {
size(1300,600);
}
void draw() {
smooth();
stroke(0, 0, 255);
for( int spaltenNummer=0; spaltenNummer < daten[0].length; spaltenNummer++) // should read how many lines there are
{
line(100+x,50,100+x,500);
x = 200+x;
}
}
Thanks a lot!
1