seltames Programm 
Author Message
 seltames Programm

Hi zusammen!

Kennt zufaellig irgendeiner noch weitere seltsame C-programme,
wie das beiliegende Programm "poem.c"?

Mit freundlichen Gruessen
Patrick

[ poem.c < 1K ]
#include <stdio.h>
main(t,_,a)
char *a;
{
return!0<t?t<3?main(-79,-13,a+main(-87,1-_,main(-86,0,a+1)+a)):
1,t<_?main(t+1,_,a):3,main(-94,-27+t,a)&&t==2?_<13?
main(2,_+1,"%s %d %d\n"):9:16:t<0?t<-72?main(_,t,

;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l \
q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw'i;# \
){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' \
iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n'')# \

Quote:
}'+}##(!!/")

:t<-50?_==*a?putchar(31[a]):main(-65,_,a+1):main((*a=='/')+t,_,a+1)
:0<t?main(2,2,"%s"):*a=='/'||main(0,main(-61,*a,

Quote:
}



Sat, 24 Aug 2002 03:00:00 GMT  
 seltames Programm

Quote:

> Hi zusammen!

> Kennt zufaellig irgendeiner noch weitere seltsame C-programme,
> wie das beiliegende Programm "poem.c"?

> Mit freundlichen Gruessen
> Patrick

<snip>

<translation of relevant parts of post into English:>
Would anybody know of any other "strange" C programs like the one below
(which was snipped)?

Hi Patrick,

<English follows>
Erstens, solltest Du bitte nur in Englisch hier schreiben -- clc ist ein
internationaler newsgroup.  Zweitens, solltest Du bitte keine
Attachments schicken -- bitte Code im Email.

Um Deine Frage zu antworten, koenntest Du vielleicht bei www.ioccc.org
etwas finden...

Gruesse,
Selim

<English>
Firstly, you should please only post to clc in English as it is an
international newsgroup.  Secondly, don't send attachments, but rather
include the source in the email.

Regarding your question, please take a look at www.ioccc.org -- you may
find something...

Cheers,
Selim



Sat, 24 Aug 2002 03:00:00 GMT  
 seltames Programm
The biggest problem that I can see is that you are trying to call function main
from with in the main body of the program. Some of the other programmers here
can help you a lot more then I can if you write your questions in English.
Quote:

> Hi zusammen!

> Kennt zufaellig irgendeiner noch weitere seltsame C-programme,
> wie das beiliegende Programm "poem.c"?

> Mit freundlichen Gruessen
> Patrick

>   ------------------------------------------------------------------------
> #include <stdio.h>
> main(t,_,a)
> char *a;
> {
> return!0<t?t<3?main(-79,-13,a+main(-87,1-_,main(-86,0,a+1)+a)):
> 1,t<_?main(t+1,_,a):3,main(-94,-27+t,a)&&t==2?_<13?
> main(2,_+1,"%s %d %d\n"):9:16:t<0?t<-72?main(_,t,

> ;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l \
> q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw'i;# \
> ){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' \
> iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
> ;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n'')# \
> }'+}##(!!/")
> :t<-50?_==*a?putchar(31[a]):main(-65,_,a+1):main((*a=='/')+t,_,a+1)
> :0<t?main(2,2,"%s"):*a=='/'||main(0,main(-61,*a,

> }



Sat, 24 Aug 2002 03:00:00 GMT  
 seltames Programm

Quote:

> The biggest problem that I can see is that you are trying to call function main
> from with in the main body of the program. Some of the other programmers here

<snip>

------------------------------------------------------------------------

Quote:
> > #include <stdio.h>
> > main(t,_,a)
> > char *a;
> > {
> > return!0<t?t<3?main(-79,-13,a+main(-87,1-_,main(-86,0,a+1)+a)):
> > 1,t<_?main(t+1,_,a):3,main(-94,-27+t,a)&&t==2?_<13?
> > main(2,_+1,"%s %d %d\n"):9:16:t<0?t<-72?main(_,t,

> > ;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l \
> > q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw'i;# \
> > ){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' \
> > iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
> > ;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n'')# \
> > }'+}##(!!/")
> > :t<-50?_==*a?putchar(31[a]):main(-65,_,a+1):main((*a=='/')+t,_,a+1)
> > :0<t?main(2,2,"%s"):*a=='/'||main(0,main(-61,*a,

> > }

Last time I checked, it was perfectly legal to call main from within
main.  This doesn't change the fact that I've never done it, and can
think of very few instances where it would be appropriate.  I would
prefer having a  dummy function do that.  eg:

<uncompiled code>

void dummy_main(int i);

int main(int argc char *argv[]) {
        dummy_main(argc);
        /* do some other stuff */
        return 0;

Quote:
}

void dummy_main(int i) {
        if (i > 0) {
                /* something here */
                dummy_main(i-1);
        }
        return;

Quote:
}

Fairly useless and trivial example, but imho, slightly more maintanable
than a main calling itself...

Cheers,
Selim



Tue, 27 Aug 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Running a programm from inside my c-programm ...

2. Including a MFC-Class into a Programm?

3. Startup Group how to Add Programm

4. Kleiner Bug in meinem Programm: Hilfe gesucht!

5. C Programm Question

6. need helf in a ordering programm

7. Problem with C for the mathematical programm

8. Mouse doesn't work with serial programm

9. Search for SCSI-Device Interface Programm

10. Programm-Icon ?nder mit VC++5.0

11. How can I install a ODBC-programm?

12. Setting LaunchPermission from a programm.

 

 
Powered by phpBB® Forum Software