All pastes #228664 Raw Edit

Unnamed

public c v1 · immutable
#228664 ·published 2006-10-30 05:29 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <sys/time.h>#include <signal.h>#include <curses.h>#include "ino.h"main (int a, char **v){	init_curses();	if (a > 1)		if (!strcmp(v[1],"make"))		{			FILE *md = fopen ("_mapthing.map", "w");			if (!md)				return 0;			int a, b;			for (a = 0; a < LINES; ++a)			{				for (b = 0; b < COLS; ++b)					putc ('*',md);				putc ('\n',md);			}			endwin ();			return 0;		} else if (!strcmp(v[1],"use"))		{			FILE *md = fopen ("_mapthing.map", "r");			if (!md)				return 0;			map = md;			usemap = 1;		}	init_singal();	init_character (&mainChar);	init_scenery (&scene);	int inp;	while (1)	{		inp = getch();		if (inp == KEY_LEFT)			move_char (&mainChar, LEFT_, scene);		if (inp == KEY_RIGHT)			move_char (&mainChar, RIGHT_, scene);		if (inp == KEY_UP)			move_char (&mainChar, UP_, scene);		if (inp == KEY_DOWN)			move_char (&mainChar, DOWN_, scene);	}	return 0;}