The rooms of the dungeon are to be stored in a 2-D array, of afixed size of 6 ro
ID: 3611332 • Letter: T
Question
The rooms of the dungeon are to be stored in a 2-D array, of afixed size of 6 rows by 4 columns. The name of the file storing theroom information will come in as a command-line argument.
The user wins the game when they enter a room that says theyfound the goal and a description of how they get out of the dungeon(e.g., search for the word "goal").
where the first two numbers are the row and column into the 2-Darray that keeps track of all the rooms in the dungeon, and therest of the line is a description of the room.
Output for command-line argument of rooms.txt
Explanation / Answer
please rate - thanks what does look around do? so far, #include #include #include using namespace std; void readRoomFile(char[],string[][4]); string getRoomDescription(int,int,string[][4]); void printRoom(string); char menu(); void printwelcome(); void help(); int main(int argc, char * argv[]) { string info[6][4],str; char choice; int row=0,col=0; readRoomFile(argv[1],info); printwelcome(); for(;;) {str=getRoomDescription(row,col,info); printRoom(str); choice=menu(); switch (choice) {case 'h':help(); break; case 'q': return 0; case 'n': break; case 's': break; case 'e': break; case 'w': break; case 'l': break; } } } string getRoomDescription(int i,int j,string mat[][4]) {return mat[i][j]; } void printRoom(string str) {int expos,perpos,pos=0,fdpos; string mess; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.