That is not correct. The initial values of the array are all 0's so it checks all 10 numbers to see if they match. Here is an example output after the first roll.
----------------
d1: 4
d2: 6...
Type: Posts; User: theoriginalanomaly
That is not correct. The initial values of the array are all 0's so it checks all 10 numbers to see if they match. Here is an example output after the first roll.
----------------
d1: 4
d2: 6...
You are calling the index "System.out.println("index is: " + sumArray[i]);" that is the value you want i. Also, you have the check running everytime you fill the index so it is checking a bunch of...
instead of break, you could break out of the first loop by i = sumArray.length -1;
--- Update ---
Now that I think about it. It would be more efficient to make the second for loop
for...
for (int i = 0; i < sumArray.length; i++){
for (int j = sumArray.length -1; j >= 0; j--){
if (( i != j) && (sumArray[i] == sumArray[j])){
System.out.println("You win!");
...