elseif(!strcasecmp(name,"quit"))cmdQuit(game);/* cmd=="quit" -> call cmdQuit(). Also properly shuts the game down */
elseif(!strcasecmp(name,"look"))cmdLook(game,args);/* cmd=="look" -> call cmdLook(). args specify where/what to look. game contains the necessary info about stuff to look at */
elseif(!strcasecmp(name,"go"))cmdGo(game,args);/* cmd="go" -> call cmdGo(). args specify where to go. game contains info about locations and will update the player's location */
elseprintf("Command not found. Try 'help'\n");
}
elseprintf("Command not found. Try 'help'\n");
}
}
/* reads a user input command line and process to progress in the game */
voidprocessCommand(Game*g)
{
char*s=getInput();/* reads a user input line */
parseAndExecute(s,g);/* process it, and move in the game */
if(s)free(s);/* deallocate the string from getInput() */