a few moments ago I started my code in java until I got a problem ... In the console was present / written this:
Exception in thread "Thread-2" java.lang.ArithmeticException: / by zero.
at MyPackage.MyClass.draw (MyClass.java:180) ...
I went to the class where the error came from, this is the code:
if (map [row] [col] == 0) continue;
int rc = map [row] [col];
int r = rc / numTilesAcross;
int c = rc% numTilesAcross;
...
col and row have the value of 0 ... I do not understand where the problem is ... someone would help me?
Thanks so much.
numTilesAcrossis never zero. Since that is the only place you are dividing by a variable that you shared, and you didn't show us hownumTilesAcrossis defined there isn't much more help we can offer.