-
Notifications
You must be signed in to change notification settings - Fork 0
/
wake-up-neo.c
76 lines (56 loc) · 1.14 KB
/
wake-up-neo.c
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <ncurses.h>
#include <string.h>
int main(void)
{
initscr();
curs_set(0);
char text1[] = "Wake up, Neo...";
char text2[] = "The Matrix has you...";
char text3[] = "Follow the white rabbit.";
char text4[] = "Knock, knock, Neo.";
char* t = text1;
int len = strlen(text1);
if (!has_colors() || start_color() != OK) {
printf("Cannot start colors!");
return 1;
}
init_pair(1, COLOR_GREEN, COLOR_BLACK);
attrset(COLOR_PAIR(1)| A_BLINK | A_BOLD);
move(3, 3);
while (len--) {
addch(*t++);
refresh();
napms(150);
}
napms(5000);
clear();
len = strlen(text2);
t = text2;
move(3,3);
while (len--) {
addch(*t++);
refresh();
napms(200);
}
napms(4000);
clear();
len = strlen(text3);
t = text3;
move(3, 3);
while (len--) {
addch(*t++);
refresh();
napms(100);
}
napms(4000);
clear();
len = strlen(text4);
t = text4;
move(3, 3);
attroff(A_BLINK);
addstr(text4);
napms(3000);
getch();
endwin();
return 0;
}