Newsgroups: comp.ai.games
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!newsfeed.internetmci.com!news.kei.com!nntp.coast.net!torn!utnut!cannon.ecf!skule.ecf!suh
From: SUH JOHN HYON-HO <suh@ecf.toronto.edu>
Subject: Sliding Tile Game Solver
X-Sender: suh@skule.ecf
X-Nntp-Posting-Host: skule.ecf
Content-Type: TEXT/PLAIN; charset=US-ASCII
Message-ID: <Pine.SGI.3.91.960315223936.19151A-100000@skule.ecf>
Sender: news@ecf.toronto.edu (News Administrator)
Organization: University of Toronto, Engineering Computing Facility
Mime-Version: 1.0
Date: Sat, 16 Mar 1996 04:59:56 GMT
Lines: 29

I am working on a program in C that will solve a sliding tile game of NxN
tiles (ie. 3x3, 4x4 or 5x5). The inputs to the program will be a series of 
integers that will be placed on the board in the order they will be entered.
For example, on a 3x3 board if the input is 2 4 5 1 6 7 8 3 0 the board 
would be like this:
                 _____________
                 | 2 | 4 | 5 |
                 |-----------|
                 | 1 | 6 | 7 | 
                 |-----------|
                 | 8 | 3 |   |
                 -------------
The program will give the solution by giving all the directions that the 
blank tile should be moved in. For example if the blank is moved up, it 
would be interchanged with the 7.
I am going to use a Least Cost Search, developing nodes by moving the 
blank in all possible directions. The cost function would be the number 
of tiles out of position and the number of moves of the blank from the 
starting position.

Questions:
- how should I create each node, as a matrix of the board at each position?
- how can I implement a priority queue to store and search the nodes?
- can anybody assist in the code? I'm having problems writing up this
  search function. 
- does anybody know of a site where there are similar programs?

Any ideas on this program would be greatly appreciated. 

