Question: The small program in C++ below roughly represents a robot in a room. The room is dened as a 2 dimensional array of characters. Objects
"The small program in C++ below roughly represents a robot in a room. The room is dened as a 2 dimensional array of characters. Objects in the room are stored as characters in the array. For example, the location of the robot is stored as an R in the array. The walls of the room are stored in the array as a - for the top and bottom walls and as | for the side walls. The function named setup() puts all of the initial characters into the 2 dimensional array. *****Use the curses library to write a function that prints the room.***** The function should take the room array as an argument. The function should loop through the entire array, moving to the correct location of the screen and printing the character stored in the array. E.g., the function should move to location (r,c) and print the [r][c]th element of the array for each r and c within the dimensions of the room. #include
*******Add code to search the room for the robot later on. If it is found, mark it with an X, if not, mark the location with a ..*****"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
