Exercise #9
The c?.c programs are curses based. The f?.c programs are file based (fopen /
fgetc / fgets / fputc). The curses programs include a c.h header file which
includes most if not all the header files you need for your program and
prototypes for functions in util.c that have been provided for you to use in
your curses programs to make life easier.
These are:
int R(int a, int b);
- Returns a random number between a and b (inclusive)
Example:
int x = R(1,10); // x will have a value between 1 to 10
void init_curses(void);
- Does all the curses initialization that your programs require, including setting up all the color pairs for you and turning off the cursor.
void leave_curses(void);
- Contains all the needed curses shutdown code.
The provided Makefile will allow the make program to build all the programs,
including the curses programs with the util.c file for you. It is not
recommended to modify the util.c file or duplicate it in your own programs.
This is an example of using an external C file for holding more code, so
your program does not need to have those functions in it.