I'm trying to make an armour system for a text game using a 2D array in Java. I've got it all figured out in my head but the code doesn't seem to work.
public static String[][] armour = new String[2][3];
{
armour[0][0] = "shirt";
armour[0][1] = "plate";
armour[0][2] = "iron";
armour[1][0] = "1";
armour[1][1] = "0.75";
armour[1][2] = "0.5";
}
public static void main(String[] args) {
System.out.println(armour[0][1]);
}
This should return "plate" but it doesn't, and I have been looking it up, modifying it and all sorts for hours now and I cannot for the life of me figure it out. Does anybody here know?