Include additional header and separate file
This commit is contained in:
parent
5c835b851e
commit
f9c2300ced
6
extras.c
Normal file
6
extras.c
Normal file
@ -0,0 +1,6 @@
|
||||
#include <ncurses.h>
|
||||
#include "extras.h"
|
||||
|
||||
void writeExtras(){
|
||||
addch(ACS_PI);
|
||||
}
|
9
main.c
9
main.c
@ -1,10 +1,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <ncurses.h>
|
||||
#include "extras.h"
|
||||
|
||||
int main(int argc,char**argv) {
|
||||
int rows,cols;
|
||||
|
||||
initscr();
|
||||
start_color();
|
||||
init_pair(1,COLOR_RED,COLOR_BLACK);
|
||||
getmaxyx(stdscr,rows,cols);
|
||||
raw();
|
||||
keypad(stdscr,TRUE);
|
||||
@ -16,11 +19,13 @@ int main(int argc,char**argv) {
|
||||
addch(ACS_BLOCK);
|
||||
addch(ACS_BSBS);
|
||||
addch(ACS_BTEE);
|
||||
addch(' ');
|
||||
writeExtras();
|
||||
mvaddch(5,17,ACS_DARROW);
|
||||
|
||||
attron(COLOR_PAIR(1));
|
||||
mvprintw(4,7,"There are %dx%d squares.",rows,cols);
|
||||
|
||||
mvchgat(4,10,4,A_REVERSE,0,NULL);
|
||||
attroff(COLOR_PAIR(1));
|
||||
refresh();
|
||||
getch();
|
||||
endwin();
|
||||
|
Loading…
x
Reference in New Issue
Block a user