This is back to the beginning of Java 101, but I have this code here:
if ((d==3)&&(City.walls[x--][y])){
System.out.println ("Fourth Condition true");
System.out.println (City.walls[x--][y]);
return false;
}
Even if City.walls[x--][y]) is false, and System.out.println confirms this by printing out false, it will still enter the if statement, no matter what. What am I doing wrong with the comparison? Thanks in advance.
x--will change the value ofx, so whatever x was before the if block, it will be one less inside the block, possibly giving you a misleading debugging statement.