home *** CD-ROM | disk | FTP | other *** search
- /*////////////////////////////////////////////////////
- // astar.h
- // 27jul92-bm
- *****************************************************/
- typedef unsigned int UINT;
-
- #define HASH_SIZE 161 /* primary hash table size*/
- #define FN_MAX 199 /* range of heuristic costs*/
- #define YES 1
- #define NO 0
- #define NIX -1
- #define INVALID -1
- #define PW 4 /* puzzle width */
- #define PSIZE PW * PW /* puzzle size */
- #define POLES 4 /* North,South,East,West */
- #define HOLE '-' /* place to move into */
- #define FORWARD 0 /* search S->G */
- #define REVERSE 1 /* search G->S */
- /* solution types */
- #define StoG 1 /* if goal on down search */
- #define GtoS 2 /* if goal on 1st up search */
- #define GtoS_COM 3 /* if common node on up search */
- #define GtoS_K1 4 /* if goal on 2nd up search */
- #define GtoS_K1_COM 5 /* if common node on 2nd up search */
-
- typedef struct lnode *NPTR; /* node pointer */
- struct lnode
- { NPTR Next; /* pointer to next node */
- int Num; /* node number */
- char *Dptr; /* pointer to data store */
- } ; /* : use cast if not char */
-
- typedef struct
- { unsigned int
- Gn, /* cost from source to n */
- Hn, /* estimated cost to goal */
- Dad; /* nodenum of parent node */
- char Puz[PSIZE+1]; /* string representation of puzzle */
- } PUZZLE ;
-
- NPTR DropLinked( NPTR Head );
- NPTR MakeLink( char *DataPtr, unsigned Info );
- NPTR PopLink( NPTR *Head );
- NPTR PushLink( NPTR Head, NPTR New );
- void ReleaseNodes( void );
-
-