diff options
author | b4rkod <void@Asena.localdomain> | 2023-11-10 18:21:45 +0300 |
---|---|---|
committer | b4rkod <void@Asena.localdomain> | 2023-11-10 18:21:45 +0300 |
commit | d4cfb4486022ff20c0fa35b2717bdf1dfbcddbde (patch) | |
tree | d519efe30fe18e56ac456345dfa3a7efc70e741b /test.c | |
parent | 6d8b02d44cd04c016e06a2ebd7e1298c8932d807 (diff) |
test
Diffstat (limited to 'test.c')
-rw-r--r-- | test.c | 63 |
1 files changed, 63 insertions, 0 deletions
@@ -0,0 +1,63 @@ + +#include <stdlib.h> +#include <stdio.h> +#include <curses.h> +#include <unistd.h> + +#define ms 50000 + +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); + attron(COLOR_PAIR(1)); + move(1, 10); + for (int i = 1; i <= 19; i++) { + move(1, (11 + i)); + addch('X'); + refresh(); + usleep(ms); + } + attron(COLOR_PAIR(2)); + for (int i = 1; i <= 19; i++) { + move((1 + i),30); + addch('X'); + refresh(); + usleep(ms); + + } + attron(COLOR_PAIR(3)); + for (int i = 1; i <= 19; i++) { + move(20, (30 - i)); + addch('X'); + refresh(); + usleep(ms); + + } + attron(COLOR_PAIR(4)); + for (int i = 1; i <= 19; i++) { + move((20 - i), 11); + addch('X'); + refresh(); + usleep(ms); + + } + + refresh(); + getch(); + delwin(mainwin); + endwin(); + refresh();; +} + |