summaryrefslogtreecommitdiff
path: root/test_1.c
diff options
context:
space:
mode:
authorb4rkod <void@Asena.localdomain>2024-01-17 21:17:07 +0300
committerb4rkod <void@Asena.localdomain>2024-01-17 21:17:07 +0300
commitb03b61b232c1fa0b9ff1ae607232f8ab3f55ea38 (patch)
tree9169255eae57e59035595768e8dd46cfaba28f50 /test_1.c
parent2fa043277b090a37b3f378a2fefccc57b5bd2814 (diff)
Diffstat (limited to 'test_1.c')
-rw-r--r--test_1.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/test_1.c b/test_1.c
new file mode 100644
index 0000000..d3a75e6
--- /dev/null
+++ b/test_1.c
@@ -0,0 +1,64 @@
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <curses.h>
+#include <unistd.h>
+
+#define ms 20000
+
+int main(void)
+{
+ WINDOW * mainwin;
+
+ if ( (mainwin = initscr()) == NULL ) {
+ fprintf(stderr, "Error initialising ncurses.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ start_color();
+ init_pair(1, COLOR_GREEN, COLOR_BLACK);
+ init_pair(2, COLOR_CYAN, COLOR_BLACK);
+ init_pair(3, COLOR_RED, COLOR_BLACK);
+ init_pair(4, COLOR_YELLOW, COLOR_BLACK);
+ for (int f = 0; f <= 9; f++){
+
+ attron(COLOR_PAIR(1));
+ for (int i = 1; i <= (19 - (f * 2)); i++) {
+ move(1 + f, ((11 + f) + i));
+ addch('X');
+ refresh();
+ usleep(ms);
+ }
+ attron(COLOR_PAIR(2));
+ for (int i = 1; i <= (19 - (f * 2) ); i++) {
+ move((f + i),(30 -f));
+ addch('X');
+ refresh();
+ usleep(ms);
+
+ }
+ attron(COLOR_PAIR(3));
+ for (int i = 1; i <= (20 - (f * 2)); i++) {
+ move((20 - f), (31 - (i+f)));
+ addch('X');
+ refresh();
+ usleep(ms);
+
+ }
+ attron(COLOR_PAIR(4));
+ for (int i = 1; i <= (19 - (f * 2)) ; i++) {
+ move((20 - (i + f)), (11 + f));
+ addch('X');
+ refresh();
+ usleep(ms);
+
+ }
+ }
+
+ refresh();
+ getch();
+ delwin(mainwin);
+ endwin();
+ refresh();;
+}
+