#include #include #include "xiso.h" void initR(); int main() { int done=0, sloc[2]={4,4}; class User *loser= new User(sloc, 10); // start location at 4,4; start score at 10 char resp; int i=0, j=0; printf("Something happens.\n"); initR(); while (!done) { if ((loser->getRoom(loser->getLoc() ) )->getDesc() !=NULL ) { printf("%s\n", (loser->getRoom(loser->getLoc() ) )->getDesc()); printf("Exits:\n"); //dbg for(j=0; j<8; j++) { printf("\t%d.%d", (loser->getRoom(loser->getLoc() ) )->dirPossQ(j), (loser->getRoom(loser->getLoc() ) )->exitLockedQ(j) ); } printf("\n"); } else { printf("Error: problem with the room's description pointer.\n"); done=1; break; } resp=parseResp(); printf("Dir:%d\n", resp); //dbg switch(resp) { case 0: // F case 1: // A case 2: // L case 3: // L case 4: // T case 5: // H case 6: // R case 7: // U loser->changeLocation( (int) resp); break; case 8: printf("Exiting Xiso...\n"); done=1; break; case 9: printf("Help\n\tn\tnorth\n\tne\tnortheast\n\te\teast\n\tse\tsoutheast\n"); printf("\ts\tsouth\n\tsw\tsouthwest\n\tw\twest\n\tnw\tnorthwest\n"); printf("\tl\tlook (print room description)\n"); printf("\tq\tquit\n\th\thelp\n\n"); break; case 10: break; default: printf("Command not yet supported.\n"); done=1; break; } /*printf("%d\n", i); //dbg loser->changeLocation(i); i++; if(i>7) { done=1; }*/ } return 0; } int mstreq(char*first, char*second) { int i=strlen(first), j=strlen(second), k; if(i!=j) { return 0; } for(k=0; k