IOCCC:程序也疯狂!
IOCCC:The International Obfuscated C Code Contest
据CSDN报道:第18届国际模糊C语言编程大赛于格林威治时间2005年3月21日0时正式开始,截止时间为2005年5月22日23时59分59秒。
这里“模糊”的目标是:
- 按照以下规则写出最朦胧而模糊的C程序 | To write the most Obscure/Obfuscated C program under the rules below
- 用讽刺的方法来展示编程风格的重要 | To show the importance of programming style, in an ironic way
- 用非常规的代码来给C编译器施压 | To stress C compilers with unusual code
- 来阐明一些C语言的微妙之处 | To illustrate some of the subtleties of the C language
- 为糟糕的代码提供一个安全的考虑 | To provide a safe forum for poor C code
看起来很有意思,在当今人人都在学习软件工程和程序设计方法学的今天,有人组织这样一个另类的活动,搜集最“糟糕”的代码。我毫不犹豫的登陆了赛事主页。很高兴得是,这里可以下载到历届的获奖程序。于是迫不及待的down了2004年的压缩包。随便打开一个程序一看,我得眼睛就瞪圆了。程序的名字叫gavare,作者是瑞典人Anders Gavare,奖项为Best Use of Light and Spheres。别眨眼睛,程序源代码和运行结果如下:

很吸引人不是么?这个程序没有一个保留字!
用作者的话说,保留字在大多数的编辑器中都会粗体显示,这样打印出来会浪费不必要的墨水……他还建议所有人都应该不使用保留字来写C程序,我们的世界会因此变得更好……
Another reason for writing code without using reserved words is that manytext editors will make all reserved words turn BOLD when printed onpaper. Since I care for the global environment, we shouldn’t waste anymore laser toner, or ink, than necessary. Everyone should write C codewith no reserved words, and our world will be a better place.
还等什么?行动起来混乱一下吧!哈哈……原来程序可以这样写(如果不需要给别人读自己也不会再读的话)……
!!后记:事实上,IOCCC_RAY的运行效果比我的截图要漂亮许多,可能是我在windows下cygwin运行的缘故,有时间试试在实linux下运行。
真正的运行效果:

Trackback: http://tb.donews.net/TrackBack.aspx?PostId=311758


Recent Comments