Hey

you can do the upper half with a nested for loop but I don’t know if you can do the lower half with a for loop. Unfortunately, I didn’t manage to do it

I hope I could help you

Here is my code:

```
int[] numbers = new int[]{1, 1, 1, -1, 1};
ArrayList<Integer> abc;
void setup() {
size(200, 200);
surface.setVisible(false);//so that the canvas is not displayed
abc = new ArrayList<Integer>();
//index 0 = 4 * 0
//index 1 = 4 * 1
//index 2 = 4 * 2
//index 3 = 4 * 3
//index 4 = 4 * 4
//index 5 = 3 * 0
//index 6 = 3 * 1
//index 7 = 3 * 2
//index 8 = 3 * 3
//index 9 = 3 * 4
//index 10 = 2 * 0
//index 11 = 2 * 1
//index 12 = 2 * 2
//index 13 = 2 * 3
//index 14 = 2 * 4
//index 15 = 1 * 0
//index 16 = 1 * 1
//index 17 = 1 * 2
//index 18 = 1 * 3
//index 19 = 1 * 4
//index 20 = 0 * 0
//index 21 = 0 * 1
//index 22 = 0 * 2
//index 23 = 0 * 3
//index 24 = 0 * 4
//int a = 0;
//int b = 1;
//int c = 2;
//int d = 3;
//int e = 4;
//println(a, b, c, d, e);
//int a1 = 5;
//int b1 = 6;
//int c1 = 7;
//int d1 = 8;
//int e1 = 9;
//println(a1, b1, c1, d1, e1);
//int a2 = 10;
//int b2 = 11;
//int c2 = 12;
//int d2 = 13;
//int e2 = 14;
//println(a2, b2, c2, d2, e2);
//int a3 = 15;
//int b3 = 16;
//int c3 = 17;
//int d3 = 18;
//int e3 = 19;
//println(a3, b3, c3, d3, e3);
//int a4 = 20;
//int b4 = 21;
//int c4 = 22;
//int d4 = 23;
//int e4 = 24;
//println(a4, b4, c4, d4, e4);
for (int i = numbers.length-1; i >= 0; i--) {
for (int j = 0; j < numbers.length; j++) {
int a = numbers[i] * numbers[j];
print(a + " ");
abc.add(a);
}
println("");
}
int x1 = abc.get(0);
int x2 = abc.get(1) + abc.get(5);
int x3 = abc.get(2) + abc.get(6) + abc.get(10);
int x4 = abc.get(3) + abc.get(7) + abc.get(11) + abc.get(15);
int x5 = abc.get(4) + abc.get(8) + abc.get(12) + abc.get(19) + abc.get(20);
int x6 = abc.get(9) + abc.get(13) + abc.get(17) + abc.get(21);
int x7 = abc.get(14) + abc.get(18) + abc.get(22);
int x8 = abc.get(19) + abc.get(23);
int x9 = abc.get(24);
println(x1, x2, x3, x4, x5, x6, x7, x8, x9);
}
void draw() {
}
```