-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay.h
More file actions
36 lines (31 loc) · 703 Bytes
/
display.h
File metadata and controls
36 lines (31 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <ncurses.h>
#include <sys/ioctl.h>
#include <time.h>
#include <stdlib.h>
#define DELAY 80
#define DELAY_BOOM 200
void delay(int number_of_seconds)
{
int milli_seconds = 1000 * number_of_seconds;
clock_t start_time = clock();
while (clock() < start_time + milli_seconds)
;
}
void clearScreen(int lines, int cols){
clear();
mvprintw(lines / 2, cols / 2 - 8, "Happy New Year!!!");
}
void initDisplay(int *lines, int *cols){
initscr();
//printf("\33[?25l");
curs_set(0);
srand(time(NULL));
struct winsize w;
ioctl(0, TIOCGWINSZ, &w);
*lines = w.ws_row;
*cols = w.ws_col;
}
void exitDisplay(){
printf("\33[?25h");
endwin();
}