/* dompress.tc - tct - 3/22/2010 /* sample usage: .dompress "sptiny.lcx","sptiny.lex" ctoh int c;char a(0) [int i i=c/16;if (i<10) a(0)=i+'0';else a(0)=(i-10)+'A' i=c%16;if (i<10) a(1)=i+'0';else a(1)=(i-10)+'A' ] dompress char f(0),g(0) [ char infile(10000),byte(1),cm(14),ra(12),outfile(10000) int bite,br,ptr,sptr,w,optr pl "";ps "dompress.tc - tct - 3/22/2010";pl "" pl "";ps "please visit http://primepuzzle.com/tc/compressor.html";pl "" strcpy(cm,"EISNATROLDCUGP");cm(14)=10;strcpy(ra,"MHBYFVWKZXQJ") br=readfile(f,infile,infile+10000,1);optr=-1 if infile(0)!=255 [pl "not a valid compressed file";pl "";exit] while (++ptr9) w=w-7 outfile(++sptr)=cm(w);++ptr ] while (outfile(ptr)=='F') [ w=outfile(++ptr)-'0';if (w>9) w=w-7 outfile(++sptr)=ra(w);++ptr ] ] outfile(++sptr)=0;pl "";ps outfile writefile(g,outfile,outfile+strlen(outfile)-1,1) pl "";pl "";ps g;ps " written! (" MC br,14;ps " bytes decompressed to ";MC strlen(outfile),14;ps " bytes)";pl "" ]