Array - expand
in
Programming Questions
•
1 year ago
Hello,
I have a problem in array function - expand.
I want to expand numbers 0-90 to 0-1000.
But processing is still using numbers 0-90.
Do you have an idea why it is not working?
int[] data = {0, 10, 20, 30, 40, 50, 60, 70, 80, 90};
data = expand(data, 1000);
for (int i= 0; i < data.length; i++) {
color cp1 = get(data[i]+10, data[i]);
fill(cp1);
if ( cp1 == color(255, 255, 255)){
noStroke();
rect(0, data[i], 1, 1);
} else {
noStroke() ;
rect(0, data[i], 10, 10);
}
}
}
}
}
I have a problem in array function - expand.
I want to expand numbers 0-90 to 0-1000.
But processing is still using numbers 0-90.
Do you have an idea why it is not working?
int[] data = {0, 10, 20, 30, 40, 50, 60, 70, 80, 90};
data = expand(data, 1000);
for (int i= 0; i < data.length; i++) {
color cp1 = get(data[i]+10, data[i]);
fill(cp1);
if ( cp1 == color(255, 255, 255)){
noStroke();
rect(0, data[i], 1, 1);
} else {
noStroke() ;
rect(0, data[i], 10, 10);
}
}
}
}
}
1