/* exo.tic - lrb - 5/17/9 /* To run this program, at a DOS prompt type /* C:\>tinyc.exe exo.tic [exo] ps char b(0) [ int l;char c;l=-1 while (c=b(++l)) MC c,1 return l ] pl char b(0) [ MC 13,1;MC 10,1;ps b ] pn int n [ MC ' ',1;MC n,14 ] readfile char n(0),w(0),l(0);int u [ int k,t if (MC(1,n,0,u,3)<0) [ pl "File not found" MC u,6 return -1 ] while (w<=l+1) [ k=MC w,u,4 if (k==-1) [MC u,6;return t] if (k<-1) [MC u,6;return k] w=w+k;t=t+k ] pl"Too big";MC u,6 return -2 ] countch char a(0),b(0),c [ return MC a,b,c,8 ] gs char b(0) [ return MC b,15 ] strcpy char s(0),t(0) [ int i;while (s(i)=t(i)) ++i ] endlibrary exo [ /* count & display wurds in a toby speak dictionary file char file(20),exofile(5000),s(1),w(5);int tildes,exobytes,fl pl "exo.tic - lrb - 5/17/9";pl "" while (!fl) [pl "Enter the name of a Toby Speak dictionary file: ";fl=gs file] if (!((exobytes=readfile(file,exofile,exofile+5000,1))>0)) exit tildes=countch(exofile,exofile+exobytes,'~') strcpy(s,"s");strcpy(w," were") if (tildes==1) [strcpy(s,"");strcpy(w," was")] pl "";pn tildes;ps " wurd";ps s;ps w;ps " spotted in ";ps file ps " which has";pn exobytes;ps " bytes." pl "";pl "";ps "Press Enter ... ";MC 2 pl "";pl "";ps exofile;pl "";pl "" ]