Please consider a donation to the Higher Intellect project. See https://preterhuman.net/donate.php or the Donate to Higher Intellect page for more info.

Bears.c

From Higher Intellect Vintage Wiki
Jump to navigation Jump to search
#include	<stdio.h>
#include <curses.h>
#include <signal.h>
#include <errno.h>

extern	int	errno;
extern	char 	*calloc();
 
#define max(a,b) ((a) > (b) ? (a) : (b))
char *b0[] = {
"     _--_     _--_         ",
"    ( () )___( () )        ",
"     \           /         ",
"      (  ' _ `  )          ",
"       \  ___  /           ",
"     .__( `-' )            ",
"    / !  `---' \           ",
"   /  \         !          ",
"  !   /\        !          ",
"  !   !_\______/\.         ",
"   \    \       ! \        ",
"    \___/   )  /__/        ",
"      \    /   !           ",
"      /   !   /            ",
"     !   /__ /___          ",
"     (______)____)         ",
NULL
};
char *b1[] = {
"    _--_     _--_          ",
"   ( () )___( () )         ",
"    \           /          ",
"     (  ' _ `  )           ",
"      \  ___  /            ",
"       ( `-' )             ",
"    _--'`---_              ",
"   /         \___          ",
"  /   /       !  \         ",
" (   <        !__/         ",
"  \   \      /\            ",
"   \--/   \ /  \  ._       ",
"     `.    )-   \/  )      ",
"      !   !  `.    /       ",
"      /  /__   \__/        ",
"     (______)              ",
NULL
};
char *b2[] = {
"    _--_     _--_          ",
"   ( () )___( () )         ",
"    \           /          ",
"     (  ' _ `  )           ",
"      \  ___  /            ",
"       ( `-' )             ",
"     .--`---'\             ",
"    /        _>\           ",
"   /  /-___-'   )          ",
" /'  (        _/           ",
" \___/`------' )           ",
"      \      `<            ",
"    ___>-_     \   /-\     ",
"   /      `-_   `-/  /     ",
"  (  \---__/ `-_    /      ",
"   \__)         `-_/       ",
NULL
};
char *b3[] = {
"    _--_     _--_          ",
"   ( () )___( () )         ",
"    \           /          ",
"     (  ' _ `  )           ",
"      \  ___  /            ",
"    .__( `-' )  ___        ",
"   /   /`---'`-'   \       ",
"  /   /          ._/   __  ",
"/'   /.-----\___/     /  ) ",
"\___//          `----'   ! ",
"     \            ______/  ",
"      `--_____----'        ",
"        \    /             ",
"        !   !              ",
"        /  /__             ",
"       (______)            ",
NULL
};
/*
 * local procedure declarations.
 */
main()
{
	initialize();

	say_hello();

	blast_out();
}

initialize()
{
    printf("Initializing ...\n");
    initscr();
}

blast_out()
{
    endwin();
    exit(0);
}

dance(src)
char **src;
{
    int i;

    i = 0;
    while (src[i]) {
	mvaddstr(i, 0, src[i]);
	i++;
    }
}
say_hello()
{
    WINDOW *foo;
    char buf[80];

    foo = newwin(12, 60, 12, 12);

    sprintf(buf, "hello world");
    mvwaddstr(foo, 3, 3, buf);
    box(foo, '|', '-');

    wrefresh(foo);

    getch();

    clear();
    refresh();
while(1) {
    dance(b0);
    refresh();
    sleep(2);
    dance(b1);
    refresh();
    getch();
    dance(b2);
    refresh();
    getch();
    dance(b3);
    refresh();
    getch();
    clear();
    refresh();

}
    return(0);
}