#include "curses.h" #include #include #define S 40 int main() { srand(time(NULL)); initscr(); resize_term(S,60); curs_set(0); noecho(); int h=100,t=0,p=2,x,y,a=20,b=20,level[S+1][S]; char*m="lost"; for(x=0;x100)h=100; while (level[x][y]>63)a--,x=a; for(x=0;x0)a+=p,p=0; } if (a<1||b<0||b>=S||h<=0)goto e; if (a>=S-1) { m="won"; goto e; } h--,x=39; goto f; e: mvprintw(20,22,"You %s in %d turns!",m,t); refresh(); getch(); }