C code decoding! 
Author Message
 C code decoding!

Hi! C Experts!
 I am new to C  proramming. Here is a classical C Program which according to
 books is known by many C programmers. I am having diffculty decoding this
 program.
 For your help it gives "Hello World " as output and runs on Borland env, I am
 not sure about Unix.
 Any help would be greatly appreciated.......

*************** C proram follows ************

#include <stdio.h>
#define TWENTYNINE 29
long ll,L1,l0,h_1,q,h1,h;

main()
        {
        for(putchar(putchar((h=7)*10+2)+TWENTYNINE);
           l0?putchar(l0) :!h_1;
           putchar(ll),L1==2?ll=' ':0){
           L1++==0?(ll=l0=54<<1):ll=='l'&&L1<3?(ll+=1L |1L<<1L,l0=0)
           :L1==sizeof L1&&ll==' ' ?(ll=19+h1): (q-=h1);
           L1==5?ll-=8:q&&&
           h_1;L1==sizeof ll+2?
           (ll+=3):1L;ll==(h<<4)+2
           &&L1!=6?(ll=ll-6):(h1=100L);L1!=1L<<3?q--
           :(h_1=ll=h1);

        }
        printf("%s\n",0);
        }



Tue, 20 Sep 1994 12:41:47 GMT  
 C code decoding!

Quote:

>Hi! C Experts!
> I am new to C  proramming. Here is a classical C Program which according to
> books is known by many C programmers. I am having diffculty decoding this
> program.

So would anyone.  The fault is not in you, but in that gobbledygook.
Whatever books told you that C programmers willingly deal with stuff
like that, those books should be tossed into the trash.

Don't waste time trying to understand it; you'd only be learning about
bad programming style.  Not only is it horribly bad style, but it's
wrong too.  (putchar does not take a long-type argument.)

I'll quote just a few lines of the program you quoted, in case anyone
missed your article:

Quote:
>#define TWENTYNINE 29
>long ll,L1,l0,h_1,q,h1,h;

>    for(putchar(putchar((h=7)*10+2)+TWENTYNINE);
>       l0?putchar(l0) :!h_1;
>       putchar(ll),L1==2?ll=' ':0){
>       L1++==0?(ll=l0=54<<1):ll=='l'&&L1<3?(ll+=1L |1L<<1L,l0=0)

--

"All my life I've wanted to be somebody. I see now I should have been
more specific."                                         --Lily Tomlin



Thu, 22 Sep 1994 11:26:16 GMT  
 C code decoding!
SK>Hi! C Experts!
SK> I am new to C  proramming. Here is a classical C Program which according to
SK> books is known by many C programmers. I am having diffculty decoding this
SK> program.
SK> For your help it gives "Hello World " as output and runs on Borland env, I a
SK> not sure about Unix.
SK> Any help would be greatly appreciated.......

SK>*************** C proram follows ************

SK>#include <stdio.h>
SK>#define TWENTYNINE 29
SK>long ll,L1,l0,h_1,q,h1,h;

SK>main()
SK>        {
SK>        for(putchar(putchar((h=7)*10+2)+TWENTYNINE);
SK>           l0?putchar(l0) :!h_1;
SK>           putchar(ll),L1==2?ll=' ':0){
SK>           L1++==0?(ll=l0=54<<1):ll=='l'&&L1<3?(ll+=1L |1L<<1L,l0=0)
SK>           :L1==sizeof L1&&ll==' ' ?(ll=19+h1): (q-=h1);
SK>           L1==5?ll-=8:q&&&
SK>           h_1;L1==sizeof ll+2?
SK>           (ll+=3):1L;ll==(h<<4)+2
SK>           &&L1!=6?(ll=ll-6):(h1=100L);L1!=1L<<3?q--
SK>           :(h_1=ll=h1);

SK>        }
SK>        printf("%s\n",0);
SK>        }

That looks like an obvuscated C programers contest entry to me!


        commiserated at Sun  04-05-1992  10:10:06
---
 * SLMR 2.1a * Real Men own computers and modem alot...



Fri, 23 Sep 1994 02:05:25 GMT  
 C code decoding!

Quote:

>SK>#include <stdio.h>
>SK>#define TWENTYNINE 29
>SK>long ll,L1,l0,h_1,q,h1,h;

>SK>main()
>SK>        {
>SK>        for(putchar(putchar((h=7)*10+2)+TWENTYNINE);
>SK>           l0?putchar(l0) :!h_1;
>SK>           putchar(ll),L1==2?ll=' ':0){
>SK>           L1++==0?(ll=l0=54<<1):ll=='l'&&L1<3?(ll+=1L |1L<<1L,l0=0)
>SK>           :L1==sizeof L1&&ll==' ' ?(ll=19+h1): (q-=h1);
>SK>           L1==5?ll-=8:q&&&
>SK>           h_1;L1==sizeof ll+2?
>SK>           (ll+=3):1L;ll==(h<<4)+2
>SK>           &&L1!=6?(ll=ll-6):(h1=100L);L1!=1L<<3?q--
>SK>           :(h_1=ll=h1);

>SK>        }
>SK>        printf("%s\n",0);
>SK>        }

>That looks like an obvuscated C programers contest entry to me!

I think it originated in an article titled "UN*X" in the 1986 April Fool
issue of Computer Language magazine.  This program was printed on page 64
of the 4/86 issue.

--



Fri, 23 Sep 1994 22:00:29 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Newbie: separate big .cs file into small .cs files

2. Include code in other Cs files

3. newbe/cs student, need help w/ code

4. Compile CS source code using ICodeCompiler

5. cs source code

6. Help - Code decodes encoded Html

7. Decoding RSPC (Reed Solomon Product Code)

8. code for encode/decode

9. uuencode/decode src code

10. Decoding GIF file in C? [Source code here]

11. source code of gif encoding and decoding?

12. How to show/call Form2.cs from Form1.cs ?

 

 
Powered by phpBB® Forum Software