saif Active member
| Subject: JAVA ISC Practical exam level question Sat Nov 28, 2009 10:02 pm | |
| Write a program to solve the 8-puzzle problem.
8-puzzle:It is played on a 3-by-3 grid with 8 square blocks labeled 1 through 8 and a blank square. Your goal is to rearrange the blocks so that they are in order. You are permitted to slide blocks horizontally or vertically into the blank square. The following shows a sequence of legal moves from an initial board position to the goal position <blockquote> initial 1 3 4 2 5 7 8 6
1 3 4 2 5 7 8 6
1 2 3 4 5 7 8 6
1 2 3 4 5 7 8 6
1 2 3 4 5 6 7 8 final </blockquote> |
|