public class PennyPitch {
int total = 0;
int[][] board = {{1,1,1,1,1}, {1,2,2,2,1}, {1,2,3,2,1}, {1,2,2,2,1}, {1,1,1,1,1}};
String[][] boardWithP = {{"1", "1", "1", "1", "1"}, {"1", "2", "2", "2", "1"}, {"1", "2", "3", "2", "1"}, {"1", "2", "2", "2", "1"}, {"1", "1", "1", "1", "1"}};
for(int i = 0; i < 4; i = i + 0){
int x = (int)(Math.random() * 5);
int y = (int)(Math.random() * 5);
if(boardWithP[x][y] != "P"){
total += board[x][y];
boardWithP[x][y] = "P";
i++;
}
}
}
So I keep getting a Syntax error
Syntax error on token ";", { expected after this token
on line 8 and
Syntax error, insert "}" to complete ClassBody
on line to and I was wondering if anyone knew what the problem was. All my brackets seem to match up and there should be a semicolon on line 8 to my knowledge. Any suggestions?