Herzlich Willkommen, lieber Gast!
  Sie befinden sich hier:

  Forum » C / C++ (ANSI-Standard) » Wow!

Forum | Hilfe | Team | Links | Impressum | > Suche < | Mitglieder | Registrieren | Einloggen
  Quicklinks: MSDN-Online || STL || clib Reference Grundlagen || Literatur || E-Books || Zubehör || > F.A.Q. < || Downloads   

Autor Thread - Seiten: > 1 <
000
24.07.2002, 12:49 Uhr
virtual
Sexiest Bit alive
(Operator)


www.es.ioccc.org/1988/phillipps.c

Ich habs bisher noch nicht verstanden, aber der Output ist überwältigend!
--
Gruß, virtual
Quote of the Month
Ich eß' nur was ein Gesicht hat (Creme 21)
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
001
24.07.2002, 12:58 Uhr
virtual
Sexiest Bit alive
(Operator)


Das ist übrigens der Output vom Programm oben:

Zitat:

On the first day of Christmas my true love gave to me
a partridge in a pear tree.

On the second day of Christmas my true love gave to me
two turtle doves
and a partridge in a pear tree.

On the third day of Christmas my true love gave to me
three french hens, two turtle doves
and a partridge in a pear tree.

On the fourth day of Christmas my true love gave to me
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the fifth day of Christmas my true love gave to me
five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the sixth day of Christmas my true love gave to me
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the seventh day of Christmas my true love gave to me
seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the eighth day of Christmas my true love gave to me
eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the ninth day of Christmas my true love gave to me
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the tenth day of Christmas my true love gave to me
ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the eleventh day of Christmas my true love gave to me
eleven pipers piping, ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the twelfth day of Christmas my true love gave to me
twelve drummers drumming, eleven pipers piping, ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.


--
Gruß, virtual
Quote of the Month
Ich eß' nur was ein Gesicht hat (Creme 21)
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
002
24.07.2002, 19:17 Uhr
~Hans
Gast



Zitat:
virtual postete
www.es.ioccc.org/1988/phillipps.c

Ich habs bisher noch nicht verstanden, aber der Output ist überwältigend!



In der Tat!
Ich blick da zwar auch nicht wirklich durch, aber es ist tatsächlich interessant. Das einzige, was mir klar ist, (das zeigt auch der output) das da ein paar Rekursionen im Spiel sind.
Ach ja, vielleicht hilft das hier ja irgendwen weiter, sofern er/sie nicht schon die selbe Idee hatte:


Code:
    .386p
    ifdef ??version
    if    ??version GT 500H
    .mmx
    endif
    endif
    model flat
    ifndef    ??version
    ?debug    macro
    endm
    endif
    ?debug    S "phillipps.c"
    ?debug    T "phillipps.c"
_TEXT    segment dword public use32 'CODE'
_TEXT    ends
_DATA    segment dword public use32 'DATA'
_DATA    ends
_BSS    segment dword public use32 'BSS'
_BSS    ends
DGROUP    group    _BSS,_DATA
_TEXT    segment dword public use32 'CODE'
_main    proc    near
?live1@0:
   ;    
   ;    main(t,_,a )
   ;    
    push      ebp
    mov       ebp,esp
    push      ebx
    push      esi
    push      edi
    mov       ebx,dword ptr [ebp+16]
    mov       edi,dword ptr [ebp+12]
    mov       esi,dword ptr [ebp+8]
   ;    
   ;    char
   ;    *
   ;    a;
   ;    {
   ;                    return!
   ;    
?live1@16: ; EBX = a, ESI = t, EDI = _
@1:
    cmp       esi,1
    jle       @2
    cmp       esi,3
    jge       short @4
    lea       eax,dword ptr [ebx+1]
    push      eax
    push      0
    push      -86
    call      _main
    add       esp,12
    add       eax,ebx
    push      eax
    mov       edx,1
    sub       edx,edi
    push      edx
    push      -87
    call      _main
    add       esp,12
    add       eax,ebx
    push      eax
    push      -13
    push      -79
    call      _main
    add       esp,12
    jmp       short @5
@4:
    mov       eax,1
@5:
    cmp       edi,esi
    jle       short @6
    push      ebx
    push      edi
    lea       edx,dword ptr [esi+1]
    push      edx
    call      _main
    add       esp,12
    jmp       short @7
@6:
    mov       eax,3
@7:
    push      ebx
    lea       edx,dword ptr [esi-27]
    push      edx
    push      -94
    call      _main
    add       esp,12
    test      eax,eax
    je        short @8
    cmp       esi,2
    jne       short @8
    cmp       edi,13
    jge       short @10
    push      offset s@
    lea       ecx,dword ptr [edi+1]
    push      ecx
    push      2
    call      _main
    add       esp,12
    jmp       @24
@10:
    mov       eax,9
    jmp       @24
@8:
    mov       eax,16
    jmp       @24
@2:
    test      esi,esi
    jge       short @12
    cmp       esi,-72
    jge       short @14
    push      offset s@+10
    push      esi
    push      edi
    call      _main
    add       esp,12
    jmp       @24
@14:
    cmp       esi,-50
    jge       short @16
    movsx     edx,byte ptr [ebx]
    cmp       edi,edx
    jne       short @18
    movsx     ecx,byte ptr [ebx+31]
    push      ecx
    call      _putchar
    pop       ecx
    jmp       short @24
@18:
    lea       eax,dword ptr [ebx+1]
    push      eax
    push      edi
    push      -65
    call      _main
    add       esp,12
    jmp       short @24
@16:
    lea       edx,dword ptr [ebx+1]
    push      edx
    push      edi
    cmp       byte ptr [ebx],47
    sete      cl
    and       ecx,1
    add       ecx,esi
    push      ecx
    call      _main
    add       esp,12
    jmp       short @24
@12:
    test      esi,esi
    jle       short @20
    push      offset s@+419
    push      2
    push      2
    call      _main
    add       esp,12
    jmp       short @24
@20:
    cmp       byte ptr [ebx],47
    je        short @22
    lea       eax,dword ptr [ebx+1]
    push      eax
    push      offset s@+422
    movsx     edx,byte ptr [ebx]
    push      edx
    push      -61
    call      _main
    add       esp,12
    push      eax
    push      0
    call      _main
    add       esp,12
    test      eax,eax
    jne       short @22
    xor       eax,eax
    jmp       short @24
@22:
    mov       eax,1
   ;    
   ;    
   ;    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,
   ;    "@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+
   ;    :
   ;    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, "!ek;dc i@bK'(q)-[w]*%n+r3#l,{}: \nuwloca-O;m .vpbks,fxntdCeghiry")
   ;    
   ;    ,a+1);}
   ;    
?live1@32: ;
@25:
@24:
    pop       edi
    pop       esi
    pop       ebx
    pop       ebp
    ret
_main    endp
_TEXT    ends
_DATA    segment dword public use32 'DATA'
s@    label    byte
    ;    s@+0:
    db    "%s %d %d",10,0
    ;    s@+10:
    db    "@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+"
    ;    s@+69:
    db    ",/n{n+,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';d"
    ;    s@+128:
    db    "q#'l q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){)"
    ;    s@+187:
    db    "{nl]'/+#n';d}rw' i;# ){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {"
    ;    s@+246:
    db    "rw' iK{;[{nl]'/w#q#n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]"
    ;    s@+305:
    db    "'/*{q#'ld;r'}{nlwb!/*de}'c ;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]"
    ;    s@+364:
    db    "'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/",0
    ;    s@+419:
    db    "%s",0
    ;    s@+422:
    db    "!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:",10
    ;    s@+454:
    db    "uwloca-O;m .vpbks,fxntdCeghiry",0
    align    4
_DATA    ends
_TEXT    segment dword public use32 'CODE'
_TEXT    ends
    public    _main
extrn   __setargv__:near
extrn   __setenvp__:near
extrn   _putchar:near
    ?debug    D "phillipps.c" 11512 38084
    end




Das hat der Borland C++ Compiler erzeugt; bcc32 -S <Dateiname>

Hans

Dieser Post wurde am 24.07.2002 um 19:40 Uhr von Uwe editiert.
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
003
24.07.2002, 19:28 Uhr
~Hans
Gast


Hallo zusammen,

in dem eben von mir geposteten Assemblerquelltext erscheint irgendwo ein Smilie, der da natürlich nicht hin gehört.

Vielleicht können die Admins das so ändern, das der Smilie da nicht mehr erscheint, bzw. interessenten lassen sich von ihrem Compiler ein Assemblerlisting erstellen.

Der Borland C++ Compiler erzeugt es wie gesagt mit diesem Aufruf von der Kommandozeile:

Code:
bcc32 -S <Dateiname>



Hans
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
004
25.07.2002, 01:09 Uhr
~Xoc
Gast


Ich hab auch mal so ein Teil geschrieben, allerdings leichter verständlich:


C++:
#include <stdio.h>

void p(char*b,int d=0){char*c,*a=b;while(d--)while(*a++!='#'&&*a!='&');for(c=a;*
a!='#';a++){if(*a == '%' || *a == '$')p(b,*++a-'A'),(a[-1] == '$')?putchar(' '):
0;else if(*a == '+')a[-1]--;else if(*a < 0)(*a)++,a = c-1;else if(*a != '&')putchar(*a);}}

int main(){
p("%B%\\%l%P%m#\n\nOn %Ze # day of Christmas my true love gave to me\n#%Qve%\
_ers%_$^&$Rpipers pip$^&$Slords%]leap%^\n&%Te ladies danc$^&$Umaids%]milk$^&$Vs\
wans%]swimm%^\n&$Wgeese%]lay$^&%Xve gold rings;\n&$Ycalling birds, &%Zree frenc\
h hens, &%[two turtle doves\n&and &%\\a partridge in a pear tree.\n#twel#eleven\
#ten#nin#eight#seven#six#fi#four#th### a-#ing,# drumm#%Z%C#f%`#%`#%`#%`#h%C#%`#\
%`#f%`#%`#ird%C#second%C#%Xrst%C#%B%[+%k+%N+\xF6#"
);}

 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
Seiten: > 1 <     [ C / C++ (ANSI-Standard) ]  


ThWBoard 2.73 FloSoft-Edition
© by Paul Baecher & Felix Gonschorek (www.thwboard.de)

Anpassungen des Forums
© by Flo-Soft (www.flo-soft.de)

Sie sind Besucher: