#include #include struct timeval cl; main() { char c; long cl0,cl1,speed; int y=10,x=10,xold,yold,i=0; initscr(); scrollok(stdscr,TRUE); leaveok(stdscr,TRUE); cbreak(); noecho(); halfdelay(0); nonl(); curs_set(0); idlok(stdscr,TRUE); do { gettimeofday(&cl,NULL); cl0=cl.tv_sec*100+cl.tv_usec/10000; c=getch(); xold=x;yold=y; if (c=='o') x--; if (c=='p') x++; if (c=='a') y--; if (c=='z') y++; mvaddch(y,x,'O'); if (cl0>=cl1) { cl1=cl0+50; mvprintw(1,1,"%ld",cl0); } refresh(); } while(c!='q'); endwin(); }