so i need some help, have random int that decide which values in my Boolean array are true. All th
System.out.println ("pick a number 1-9");
int guess;
for ( int i = 0; i < 9; ++i ){
guess = console.nextInt();
if (x[i] = true) {
System.out.println("CORRECT!!");
}else if (x[i] = false) {
System.out.println("eeeehhh wrong");
}}
System.out.print("The battleships were placed at locations " + Arrays.toString(x));
}
}
the problem with this i have noticed is it compares the whole array not going through and just hitting the values that are true