Processing Forum
// declare arrays, which have a length of 4
int [] xpos = new int [4];
ok... we make 4 elements in a lis, with an index of 0,1,2 and 3
void setup (){
size (600,600);
smooth ();
// initialize, we give each of them a starting value of 0
for ( int i = 0; i < xpos.length ; i++){
xpos[i] = 0 ;
}}
void draw (){
background (255);
// shift array values
for ( int i = 0 ; i < xpos.length-1 ; i++){
xpos [i] = xpos[i+1];
}
so we are saying, to the whole list minus one ( index 3 in this case ), we would do ''i++ ''
which means: lets add one. So what would that look like ? :
0,1,2 then these plus one ?
1,2... and then what , i cant go further is length minus one... what i'm i doing wrong ?