|
CS256 - Fundamentals of Structured Programming
| Displaying exercises/e9/files/c4.c
#include "c.h"
/**
* 1) Open the map.txt file for reading. If you cannot open it, print that you
* are unable to and waitforkeypress() and then exit the program.
* 2) Read the map one character at a time, process the map in such a way that
* each character is put on the curses screen like so:
* '#' -> a space w/ blue background
* '.' -> a space with white background
* '&' -> a '&' that is yellow on white and bold
* '+' -> a '+' that is yellow on white
* '%' -> a '%' that is red on white and bold
* 's' -> a 's' that is white on blue
* anything else should be printed as is.
* 3) Keep track of the number of lines printed (look for '\n' characters)
* and stop when you are at the last line of the screen.
*/
int main(void)
{
// Keep this:
init_curses(1);
// Put your code here:
// Leave this:
leave_curses();
return 0;
}
|