短的代码(代码转载)
注,这段代码的本体和创意是转载的(我只对它的输出结果做了小小调整)。它采用了一种“故意”混淆视听的方式来写的,你是否能够读懂并解释这段很短的代码呢?程序代码:
#include <stdio.h> void main(char _) { for(--_;putchar(_++["Ij-Ipx!bsf!zpv\"\1"]-1);); }
[[it] 本帖最后由 hoodlum1980 于 2008-3-20 17:54 编辑 [/it]]
#include <stdio.h> main() { int _,_____,bbb,T_T,o,O,I; int a,b,c,d,e; I=(O=(o=(T_T=(bbb=(_____=(_=1)*2)*2)*2)*2)*2)*2; a=-_-bbb; b=-_||bbb; c=-_____-bbb; d=T_T; e=~~~I>_<~~~!bbb; printf("%d %d %d %d %d\n",a,b,c,d,e); printf("%d\n",I<O>_<O>I==O^_^O?_-_:-_-bbb^_^o); }
/*尚未分析完成。。。。等待。。。。*/ #include <stdio.h> int k,f,g,q; int p,m=0,n=1,d=0,e=0,a=2,b=5,c=5,t=1,M[22][76]={-1,4}; L() { return a%2?(f=0,g=a/2?-1:1):(g=0,f=a/2?1:-1),\ (!M[m+f][n+g]||M[m+f][n+g]==10||M[m+f][n+g]==-1); } K() { M[m+f][n+g]==-1 && PrintGameOver(),M[m+f][n+g]!=10?F(m,n):(t=0),\ M[m+f][n+g]=(a+2)%4+1; } D() { a-0\ ||((m+f>=0&&L())?(K(),m=m+f):(a=rand()%2?3:1)),a-2\ ||((m+f<22&&L())?(K(),m=m+f):(a=rand()%2?1:3)),a-1\ ||((n+g<76&&L())?(K(),n=n+g):(a=rand()%2?0:2)),a-3\ ||((n+g>=0&&L())?(K(),n=n+g):(a=rand()%2?2:0)); } F(x,y) { M[x][y]%2?(p=0,q=M[x][y]/2?1:-1):(q=0,p=M[x][y]/3?-1:1),\ M[x+q][y+p]==-1?(M[x+q][y+p]=0,b=x+q,c=y+p,M[x][y]=-1):F(x+q,y+p); } /*找到一个空位置打印X表示食物*/ PrintFood() { int x,y; x=rand()%22,\ y=rand()%76,\ M[x][y]==0?(M[x][y]=10,gotoxy(y+1,x+2),printf("X")):PrintFood(); } PrintSnake()/* ??? */ { gotoxy(c+1,b+2),printf(" "),\ gotoxy(n+1,m+2),printf("O"),\ gotoxy(e+1,d+2),printf("o"); } PrintGameOver() { gotoxy(10,10),printf("The""g""ame is over!"),\ getch( ),\ exit(); } main() { clrscr(); /*清屏,我加的*/ PrintFood(); while(1) { while(bioskey(1)==0) d=m,e=n,\ D(),\ PrintSnake(),\ t==0&&(PrintFood(),t=1),\ delay(45000);/*我吧演示时间改长了*/ k=bioskey(0)>>8,\ k-75||\ (a=3),k-77||\ (a=1),k-72||\ (a=0),k-80||\ (a=2); } }