找回密码
 立即注册
搜索
查看: 6034|回复: 30

[分享] 第20届国际C语言混乱代码大赛源代码公布

[复制链接]
发表于 2012-4-24 13:01 | 显示全部楼层 |阅读模式
第20届国际C语言混乱代码大赛源代码公布


第20届国际C语言混乱代码大赛(IOCCC)于2月5日结束,2个半月后主办方释出了获奖作品的源代码。IOCCC要求参赛者写出最有创意的最让人难以理解的C语言代码,并限制在4 kilobytes以内,因此每位参赛者的作品都令人印象深刻。例如Don Yang的作品获得了最佳展示,他是在一个程序中包含多个程序。其它获奖作品包括文本光线跟踪器,基于X11的坦克射击游戏,ANSI代码转义序列,等等。

第一名代码:
http://uguu.org/src_akari_c.html
http://uguu.org/src_chinatsu_c.html
回复

使用道具 举报

发表于 2012-4-24 13:13 | 显示全部楼层
第一个是空白页面啊
回复

使用道具 举报

     
发表于 2012-4-24 13:21 | 显示全部楼层
为什么发在漫区
回复

使用道具 举报

     
发表于 2012-4-24 13:29 | 显示全部楼层
引用第2楼嗜睡者于2012-04-24 13:21发表的  :
为什么发在漫区



第一名
回复

使用道具 举报

发表于 2012-4-24 13:29 | 显示全部楼层
识别度不高的感觉,没有文件名我都不知道是谁……

akari   --> あかり --> 赤座灯里
chinatsu   --> ちなつ --> 吉川千夏
回复

使用道具 举报

     
发表于 2012-4-24 13:30 | 显示全部楼层
为什么发在漫区+1





直到我点开看了一下。。。。。。
回复

使用道具 举报

发表于 2012-4-24 13:32 | 显示全部楼层
世界人民的\\アッカリン~/
回复

使用道具 举报

 楼主| 发表于 2012-4-24 13:36 | 显示全部楼层
你们居然能打开到第一个...
除了404我什么都看不见哟
回复

使用道具 举报

     
发表于 2012-4-24 13:39 | 显示全部楼层
不能有业内运行一下让我们看看效果么?
回复

使用道具 举报

发表于 2012-4-24 13:39 | 显示全部楼层
跪了....
回复

使用道具 举报

     
发表于 2012-4-24 13:40 | 显示全部楼层
不止一个。。这人画了50多个
不过这些是能用的程序还是纯粹画画?
回复

使用道具 举报

发表于 2012-4-24 13:43 | 显示全部楼层
一眼就看出阿卡林了....
这人碉堡了
回复

使用道具 举报

发表于 2012-4-24 13:50 | 显示全部楼层
这玩意真的能运行么...
回复

使用道具 举报

     
发表于 2012-4-24 13:51 | 显示全部楼层
这个代码有啥用吗?
回复

使用道具 举报

发表于 2012-4-24 13:53 | 显示全部楼层

一大堆
回复

使用道具 举报

     
发表于 2012-4-24 14:02 | 显示全部楼层
谁编译了运行下看看
回复

使用道具 举报

     
发表于 2012-4-24 14:03 | 显示全部楼层
y[]="yuriyurarararayuruyuri*daijiken**akkari~n**"
回复

使用道具 举报

     
发表于 2012-4-24 14:04 | 显示全部楼层
格式确实没错。。。。。虽然有一堆乱码但是大部分都是注释和字符串。。。
回复

使用道具 举报

     
发表于 2012-4-24 14:09 | 显示全部楼层
第一个真的能运行,虽然我还没明白具体是干嘛,另外由于注释,很多代码是纯用来画图的
比如第一个的那个呆毛
回复

使用道具 举报

发表于 2012-4-24 14:13 | 显示全部楼层
回复

使用道具 举报

发表于 2012-4-24 14:15 | 显示全部楼层
能跑。无错误。没有结果。
回复

使用道具 举报

     
发表于 2012-4-24 14:15 | 显示全部楼层
Akari is an image downsampling utility that accepts 3 inout formats:

* PGM (netpbm grayscale image).  Akari only accept PGM files with this
  header: P5 <width> <height> 255.  Images with extra comments such as
  the ones produced by GIMP will not be parsed properly.

* PPM (netpbm RGB image).  Only PPM files with this header are
  accepted: P6 <width> <height> 255.

* ASCII art (with end of lines in LF bytes only, not CR-LF)

Anything that is not parseable as PGM or PPM will be downsampled as ASCII art.

Akari is an image downsampling utility. She accepts up to 3 arguments:

First argument is the input image. If it’s “-” or unspecified, Akari will read from stdin.

Second argument is the output image. If it’s “-” or unspecified, Akari will write to stdout.

Third argument, if specified, causes Akari to keep even pixels on even scanlines. By default Akari will keep odd pixels on odd scanlines.
回复

使用道具 举报

     
发表于 2012-4-24 14:18 | 显示全部楼层
当然这不是能得奖的原因...
能得奖是因为

./akari akari.c akari2.c
akari2.c is also a valid C program, and accepts up to 1 argument. By default, this second program reads text from stdin and writes expanded output to stdout. If the extra argument is specified, the output text will also pass through a rot13 filter.

Of course, we wouldn’t stop with just 2 programs, you can downsample the source again and get yet another C program:
./akari < akari.c | ./akari > akari3.c

./akari < akari.c | ./akari | ./akari > akari4.c

akari3.c and akari4.c are still (mostly valid) C programs. “gcc -Wall” will output a few warnings, but still produce output executables. The output executables each print a message to stdout.
回复

使用道具 举报

     
发表于 2012-4-24 14:22 | 显示全部楼层
艹 第一个程序终于把注释和无用的字符串删的七七八八了 剩下来的玩意别问我有什么用。。。变量好乱啊

#include<stdio.h>
int main(int n,char**m){
  FILE*p,*q;
  int A,k,a,r,i;
  char *d="P%",b[1024],y[]="yuriyurarararayuruyuri*daijiken**akkari~n**";
  int u;
  for(i=0;i<101;i++)
  y[i*2]^="~hktrvg~dmG*eoa+%squ#l2"
  p=(n>1&&(m[1][0]-'-'||m[1][1]  !='\\0'))?fopen(m[1],y+298):stdin;
  q=(n<3||!(m[2][0]-'-'||m[2][1]))?stdout :fopen(m[2],d+14);
  if(!p||!q)
    return+printf("Can not\\x20open\\40%s\\40for\\40%sing\\n",m[!p?1:2],!p?"read":"writ");
  for(a=k=u=0;y;u=2+u){
    y[k++]=y;
  }
  if((a=fread(b,1,1024,p))>2&& b[0]=='P' &&4==sscanf(b,d,&k,& A,&i,&r)&&!(k-6&&k -5)&&r==255){
    u=A;
    if(n>3){u++;i++;}
    fprintf(q,d,k,u>>1,i>>1,r);u= k-5?8:4;k=3;
  }
  else{
    (u)=+(n+14>17)?8/4:8*5/4;
  }
  for(r=i=0;;){
    u*=6;u+=(n>3?1:0);
    if(y&01)fputc(1*(r),q);if(y&16)k=A;if(y&2)k--;if(i==a){
      i=a=(u)*11&255;
      if(1&&0>=(a=fread(b,1,1024,p))&&")]i>(w)-;} {                                         /i-f-(-m--M1-0.)<{"[ 8]==59)break;
      i=0;
    }
    r=b[i++];
    u+=(+8&*(y+u))?(10-r?4:2):(y&4)?(k?2:4):2;u=y-(int)'`';
  }
  fclose(p);
  k=+fclose( q);
  return  k--1+(-0x01);
}
回复

使用道具 举报

 楼主| 发表于 2012-4-24 14:33 | 显示全部楼层

回 19楼(compiler) 的帖子

我真想不到s1连这种戏服也有啊 233
就如23楼所说,处理之后的结果也是一个c程序,这才是akarin的神奇之处..

详细说明地址
http://www.ioccc.org/2011/akari/hint.html
回复

使用道具 举报

发表于 2012-4-24 14:40 | 显示全部楼层
阿卡林终于有存在感了
回复

使用道具 举报

     
发表于 2012-4-24 14:42 | 显示全部楼层
死宅和死程某种意义上是不是挺相似的
回复

使用道具 举报

     
发表于 2012-4-24 14:45 | 显示全部楼层

Re:回 19楼(compiler) 的帖子

引用第24楼kenqqex于2012-04-24 14:33发表的 回 19楼(compiler) 的帖子 :
我真想不到s1连这种戏服也有啊 233
就如23楼所说,处理之后的结果也是一个c程序,这才是akarin的神奇之处..

详细说明地址
http://www.ioccc.org/2011/akari/hint.html
.......
大概就是 A文本编译出程序X
程序X用A做参数运行出文本B
程序X用B做参数运行出文本C
程序X用C做参数运行出文本D

这尼玛的自攻自受啊
回复

使用道具 举报

发表于 2012-4-24 15:19 | 显示全部楼层
果断摘下了眼镜。
回复

使用道具 举报

 楼主| 发表于 2012-4-24 15:23 | 显示全部楼层

回 27楼(你受我攻) 的帖子

顺便一提递归到了最后结果貌似是
akkari~n
回复

使用道具 举报

发表于 2012-4-24 17:36 | 显示全部楼层
第一个真心碉堡了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|上海互联网违法和不良信息举报中心|网上有害信息举报专区|962110 反电信诈骗|举报电话 021-62035905|Stage1st ( 沪ICP备13020230号-1|沪公网安备 31010702007642号 )

GMT+8, 2025-9-12 00:31 , Processed in 0.155971 second(s), 7 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表