I need to output a grid array that gives me an output of:
1 5 9 13 17 21
2 6 10 14 18 22
3 7 11 15 19 23
4 8 12 16 20 24
This is the code I have at this moment:
public static void printGrid(){
int x = 0, y = 0;
int[][] grid = new int[4][6];
for(int i=1; i<=(4*6); i++){
x++;
if(i%4 == 0){
y++;
x = 0;
}
}
}
Any and all help is greatly appreciated.