DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T s

⟦4afec3d7e⟧ TextFile

    Length: 1593 (0x639)
    Types: TextFile
    Names: »suicide2.c«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Suicide/suicide2.c« 

TextFile

/*
To compile:

	cc suicide2.c -lcurses -ltermcap -o suicide2

Those flags are necessary if the graphics are to work properly.
*/
/************************** BEGIN SUICIDE PROGRAM *****************************/

/*
#include <curses.h>
*/
#include "curses.h"
main()
{
	int i, j;

	static int cx[] = {
		20, 25, 30, 40, 44, 48, 57 };
	

	static char *road[] = {
		"------------------------------------------------------------------------------",
		" ",
		" ",
		" ---   ---   ---   ---   ---   ---   ---   ---   ---   ---   ---   ---   ---",
		" ",
		" ",
		"-----------------------------------------------------------------------------" };

	static char *car[] = {
		" _/-\__",
		" =o--o+"};

	static char *guy[] = {
		"o",
		"X",
		" "};

	static char *boom[] = {
		"    . *  . ",
		"   ^  : .o . ",
		"  =  \'$-# .  ",
		"   . /=./\ ",
		"     . v .  "};

	static char *cry[] = {
		"Hey!",
		"You!",
		"Watch out",
		"for",
		"the",
		"CAR !!!!"};

	static char *bye[] = {
		" ",
		" ",
		" ",
		"Bye",
		"sick",
		" world !!"};

	initscr();
	clear();
	printpic(road, 7, 8, 0);
	for(i=0; i < 60; i++) {
		printpic(car, 2, 12, i);
		if(i%10 == 0) {
			j = i/10;
			printpic(guy, 3, 17-(j), 65);
			mvprintw(3, cx[j], cry[j]);
			mvprintw(20, cx[j]+18, bye[j]);
			if(j == 5)
				mvprintw(14, 64, "---");
		}	
	}
	printpic(boom, 4, 11, 60);
	refresh();
	endwin();
	getchar();
	
}

printpic(pic, len, y, x)
char **pic;
int len, x, y;
{
	int i;
	for (i=0; i < len; i++)
		mvprintw(i + y, x, pic[i]);
	refresh();
}

/****************** END OF SUICIDE PROGRAM ************************************/