I am looking for a code in java that implements DFS and BFS for the 8-puzzle game by given initial state :
1 2 3
8 0 4
7 6 5
and Goal state
2 8 1
0 4 3
7 6 5
I need to print the solution path from initial to the goal state (Not done yet)
This is the code I have. So far I have only been able to implement DFS. What my program does so far is it outputs SUCCESS once it finds the goal state. However, it never gets to this point.
Can someone tell me where I am going wrong?