So I was trying to add 2 dimensional arrays to an array list like this:
public class game{
static ArrayList<Object> edges = new ArrayList<Object>();
static void setEdges(){
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
edges.add( {9*i+j,9*i+j+1} );
edges.add( {9*i+j , 9*i+j+9} );
}
}
}
}
But it doesn't work. What does seem to work is this:
public class game{
static ArrayList<Object> edges = new ArrayList<Object>();
static void setEdges(){
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
int[] edge = {9*i+j,9*i+j+1};
int [] edge2 = {9*i+j , 9*i+j+9};
edges.add( edge2 );
edges.add( edge );
}
}
}
}
I can't understand why the simplest method doesn't work but the other does.