NPuzzle Problem In Java, Lisp & Prolog
View Paper
ESSAY DETAILS
Words: 8655
Pages: 31
(approximately 235 words/page)
Pages: 31
(approximately 235 words/page)
Essay Database > Science & Technology > Computers and Cybernetics
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
showed first 75 words of 8655 total
Sign up for EssayTask and enjoy a huge collection of student essays, term papers and research papers. Improve your grade with our unique database!
showed first 75 words of 8655 total
showed last 75 words of 8655 total
- <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.
- <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.