#include/**/ #include # include /** */#define O()for(y-= !!\ y;y=0||E-1?T:k;k=T<0?k:T;Y(7)(0,0,"%03d%*s%03\ d",n>999?999:n,W*2-6,"",k>999?999:k);Y(9)(0,W-1,E>1?"X-(":E-1||o?":-)":"[-)");}re\ fresh();}int main(int A,char**V){short B[]={_(RED),_(BLACK),_(WHITE),_(BLUE),_(GR\ EEN),_(RED),_(MAGENTA),_(YELLOW),_(CYAN)};MEVENT e;FILE*f;srand(time(0));initscr() ;for(start_color();X<12;X++)init_pair(X+1,B[X&&X<10?X-1:2],B[X?X<3?2:1:0]);noecho( );cbreak();timeout(9);curs_set(0);keypad(stdscr,TRUE);for(mousemask(BUTTON1_CLICK\ ED|BUTTON1_RELEASED,0);;){if(A-->1){f=fopen(V[A],"r");fscanf(f,"%d %d %d",&W,&H,&C );}else{f=0;W=COLS/2;H=LINES-1;C=W*H/5;}S=W*H;M=realloc(M,S*2*sizeof (int));for(i=0;i=0 ){if(!E){for(i=0;i