All pastes #336748 Raw Edit

Something

public c v1 · immutable
·published 2007-02-02 07:02 UTC
rendered paste body
#include <stdio.h>#include "curses.h"int my_x = 1;int my_y = 1;void init() {	//Initialize curses stuff		initscr();	cbreak();	noecho();	keypad(stdscr, TRUE);	return;}int main(int argc, char **argv) {		init();			move(my_y,my_x);	addch('@');	move(my_y,my_x);			int ch;		while ((ch = getch()) != 'q') {		//printf("char: %i \r\n", ch);				int mx = 0;		int my = 0;				switch(ch) {			case KEY_LEFT:				mx -= 1;				break;			case KEY_RIGHT:				mx += 1;				break;			case KEY_DOWN:				my += 1;				break;			case KEY_UP:				my -= 1;				break;		}				mvaddch(my_y,my_x,' ');				my_x += mx;		my_y += my;				move(my_y,my_x);		addch('@');		move(my_y,my_x);				refresh();	}		endwin();					return 0;}