#include <ncurses.h>
#include <unistd.h>

enum { delay_duration = 2 };

int main()
{
    int row, col;
    initscr();
    start_color();
    cbreak();
    noecho();
    curs_set(0);
    getmaxyx(stdscr, row, col);
    move(row/2,(col-30)/2);

    attron(A_BOLD);
    addstr("Hello, ");
    refresh();
    sleep(delay_duration);

    attron(A_UNDERLINE);
    addstr("wonderful");
    refresh();
    sleep(delay_duration);

    attroff(A_BOLD|A_UNDERLINE);
    addstr(" world! ");
    refresh();
    sleep(delay_duration);

    addch('*' | A_BOLD | A_BLINK);
    refresh();
    sleep(delay_duration);

    printw(" %d ", has_colors());
    refresh();
    sleep(delay_duration);

    init_pair(1, COLOR_WHITE, COLOR_BLUE);
    attrset(COLOR_PAIR(1) | A_UNDERLINE);
    addstr("White on blue");
    refresh();
    sleep(delay_duration);

    endwin();
    return 0;
}
