I need to make a block of text that looks like this:
1 1 4
1 2 3
1 3 2
1 4 1
I have currently got this code:
for (int x = 1; x <= 4; x++) {
for (int y = 4; y >= 1; y--) {
System.out.println("1 " + x + " " + y);
}
System.out.println();
}
but it outputs the wrong thing, as
1 1 4
1 1 3
1 1 2
1 1 1
1 2 4
1 2 3
1 2 2
1 2 1
1 3 4
1 3 3
1 3 2
1 3 1
1 4 4
1 4 3
1 4 2
1 4 1
Can somebody help me? is it something with my loop syntax or something that has to do with the insides? Plus im new here, please dont be too harsh.