Hello,
I'm working at a 8 puzzle (http://www.permadi.com/java/puzzle8/)
i want to compare two arrays.
after that I want to get a true or a false and then I want to implement a algorithm.
my question is:
why can I not use 2 different variables and display the interger values of each array?
how can I continue work with the return value false/true from Arrays.equals(initialstate, goalstate).
Thanks a lot
import java.util.Arrays;
public class Input {
public static void main(String[] args) {
int[] initialstate = new int[] { 1, 2, 3, 4, 8, 0, 7, 6, 5 };
int[] goalstate = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 0 };
System.out.println(i + "initialelement:" + initialstate[i]);
System.out.println(j + "goalelement:" + goalstate[j]);
System.out.println(Arrays.equals(initialstate, goalstate));
}
}