#One-line-itis
5 messages in this thread
>> "APL syndrome."
float o=0.075,h=1.5,T,r,O,l,I;int _,L=80,s=3200;main(){for(;s%L|| (h-=o,T=
-2),s;4 -(r=O*O)<(l=I*I)|++ _==L&&putchar(*((–s%L?_<L?–_
%6:6:7)+"World! \n"))&&(O=I=l=_=r=0,T+=o /2))O=I*2*O+h,I=l+T-r;}
<float o=0.075,h=1.5,T,r,O,l,I;int _,L=80,s=3200;main(){for(;s%L|| (h-=o,T=
-2),s;4 -(r=O*O)<(l=I*I)|++ _==L&&putchar(*((–s%L?_<L?–_
%6:6:7)+"World! \n"))&&(O=I=l=_=r=0,T+=o /2))O=I*2*O+h,I=l+T-r;}>
Now you've done it! I'm going to have to install my WATCOM compiler to run your
line. (It's not a valid POCO program.)
When browsing at Barnes and Nobles I saw a book that contained the winning
entries to a contest for the most obscure C code. Couldn't believe the stuff in
it! I resisted the temptation and bought "The Best C/C++ Tips Ever" instead.
But maybe I would have learned more deciphering the code in the first book.
I am going back to the bookstore to see if any of you programs are were
included in the "obscure code" book <g>.
Ed K
>> I am going back to the bookstore to see if any of you programs are
>> were included in the "obscure code" book <g>…
Actually a few of them! Come to think of it, all my code could be categorized
as "obscure".
That one liner isn't mine. I found a while ago and found it to be pretty cute.
It's a complete fractal generator! Any C compiler will do it. It's pretty
standard C and the only function called is putchar() which is part of any basic
library.
I did a lot of APL work back in 84/85. Not much of APL but rather, I had to
implement an editor (for IBM) able to use APL characters (who else would use
APL!). I still have it and it was what I used to use as my source editor 'till
a couple of months ago (10 years!).
<. I still have it and it was what I used to use as my source editor 'till a
couple of months ago (10 years!).>
What made you give it up? Any chance I'd know what editor it was.
I'm not surprised you used it that long. I tend to stick to the same editor
also. At IBM I did a lot of work using a mainframe editor, XEDIT (81-93). When
I retired, I bought the PC copycat, KEDIT, and can't imagine switching. It
would take a while to learn a new editor to the same extent, and then I would
have to rewrite a bunch of macros. That would be a lot of work. I haven't
converted all the macros I had under XEDIT yet (I think one I wrote, for
editing REXX code, to take me to where a function was defined, and then back to
where I came from, needs to be done next).
Come to think of it, we used XEDIT to edit APL on a the mainframe for quite a
few years. That came to an end when instead of dumb terminals we started using
PCs with the OS/2 communications manager. OS/2 didn't support the APL
character set. Maybe still doesn't.
Ed K
The Obfuscated C book is actually very, very good as a learning experience. It
shows things you can do in C that you might never have dared to imagine
existed. I'd rather recommend "Code Complete" as a guide to writing clear C
code, though. When I bought it, I was quite comforted to find that I followed
almost all of its guidelines already. 🙂