Processing Forum
final byte NUM = 10; int[] a = new int[NUM]; for (int c = 0, i = 1; i != NUM;) if ( (++c & 3) == 0 ) a[i] = c - a[i++ - 1]; for (int j = 0; j != NUM - 1; print(a[j++] + ", ")); print(a[NUM - 1] + "."); exit();
int[] a = new int[10];
make an array of integers and call it "a" and give it 10 pigeonholes
int i=1,c=1;
make two integers i and c and set them equal to 1
while(i<a.length)
while i < length of the array a, so less than 10
{
if(c%4==0)
if c modulo 4 is 0, or if c is an integer multiple of 4 (4, 8, 12 ...)
{
a[i] = c - a[i-1];
make the ith entry of the array a equal to c - (i-1)th entry in the array a
i++; }
c++;
add 1 to i and add 1 to c
}
for(int j=0;j<a.length-1;j++)
for j equaling the values 0, 1, 2, ... 9 in turn
print(a[j]+",");
print(a[i-1]+".");
print these things: the jth value in the array a and the (i-1)th value in the array a
}
gotoloop's joking aside, it's appallingly formated
void setup(){int[] a = new int[10];int i = 1;int c = 1;while(i < a.length){if(c % 4 = =0){a[i] = c - a[i - 1];i++;}c++;}
for(int j = 0; j < a.length - 1; j++){print(a[j] + ",");print(a[i - 1] + ".");}}