These functions are giving me an error, asking for a semicolon, but when I add it, it doesn’t fix the error.
<>
int arrayTotal(int array[]) {
int total= 0;
for (int i= 0; i<array.length; i++) {
total+=array[i];
}
return total;
}
When processing tells you that you have a missing semicolon where you clearly doesn’t, it generally means that you have something like a missing bracket.
In your case, you’re missing a ‘)’ in this line. I believe you should add it after the ~.getDieFace().width/2
I tried that, and it is still giving me an error. Also, for arrayTotal function, it is still giving me an error. Any thoughts? int arrayTotal(int array[]) { int total= 0; for (int i= 0; i<array.length; i++) { total+=array[i]; } return total; }
In this line, you are referring 3 times to the dice[i]. (apart from the initial one).
This calls for making the line a function (method) within the class: