Thursday, May 8, 2008

8 Puzzle Code - StateNode.h

#define SIZE 9
class StateNode{
public:
char puzzle[SIZE];
char parentstate[SIZE];


StateNode* next;

StateNode(){
next=NULL;
}

void setPuzzle(char* p){
for(int v=0; v<SIZE; v++) puzzle[v]=*(p+v);
}

void setParentState(char *pp){
for(int v=0; v<SIZE; v++) parentstate[v]=*(pp+v);
}
};

No comments: