NPuzzle Problem In Java, Lisp & Prolog
Date Submitted: 09/09/2006 22:53:35
ABSTRACT
The well known N-puzzle problem consists of a square board containing N square tiles and an empty position called the "blank". Authorized operations like up, down, left and right slide any tile adjacent to the blank into the blank position. The task is to rearrange the tiles from some random initial configuration into a particular designed goal configuration. A* search is used to solve the N-puzzle in this paper. This application has been implemented
Is this Essay helpful? Join now to read this particular paper
and access over 480,000 just like this GET BETTER GRADES
and access over 480,000 just like this GET BETTER GRADES
-
<Tab/>write('\n').
printPuzzle([A,B,C|D]):-
<Tab/>write(A),
<Tab/>write(B),
<Tab/>writeln(C),
<Tab/>printPuzzle(D).
replace([Old|L0], Old, New, [New|L0]).
replace([X|L0], Old, New, [X|L]) :-
<Tab/>replace(L0, Old, New, L),
<Tab/>X\=Old.
Need a custom written paper? Let our professional writers save your time.