#include #include #define Q(x,y) for(x=1;x<=y;x++) #define BB break #define D double #define C case #define U (unsigned) char *sp="Ld/W-0.5/G*3.0-0.7SbLl/H-0.5/G*3.0SgL0SxSy",*si= "Ly*ySTLx*x-T+bSuL2.0*x*y+gSyLuSx",*sq="Lx*xSwLy*y+w";D a, v[256]={0};D gv(char **s){char t[256];int i;D r;if(isalpha (**s)){r=v[U **s];(*s)++;}else{i=0;while(isdigit(**s)||**s =='.'){t[i++]=**s;(*s)++;}t[i++]=0;r=atof(t);}return r;} D cv(char *s){while(*s){switch(*s){C 'L':s++;a=gv(&s);BB;C 'S':s++;v[U *s]=a;s++;BB;C '*':s++;a*=gv(&s);BB;C '/':s++; a/=gv(&s);BB;C '+':s++;a+=gv(&s);BB;C '-':s++;a-=gv(&s);BB ;}}return a;}main(){int l,d,t,H=23,W=72,MX=100;v['G']=0.9; v['W']=W;v['H']=H;Q(l,H){Q(d,W){v['d']=d;v['l']=l; cv(sp); Q(t,MX){cv(si);if(cv(sq)>100.0)break;}printf("\x1b[3%dm#", (t