International Obfuscated C Code Contest: Difference between revisions

Content deleted Content added
m Examples: capitalization, reference formatting, biblio data
punctuation, biblio data, reference formatting, quote formatting, capitalization, link
Line 20:
|coordinates = <!-- {{coord|LAT|LON|type:event|display=inline,title}} -->
|country =
|years_active = 1984–1996, 1998, 2000, 2001, 2004–2006, 2011–2015, 2018-20202018–2020
|first = {{start date|1984}}
|founders = [[Landon Curt Noll]], Larry Bassel
Line 39:
|footnotes =
}}
The '''International Obfuscated C Code Contest''' (abbreviated '''IOCCC''') is a [[computer programming]] contest for [[Source code|code]] written in [[C (programming language)|C]] that is the most creatively [[obfuscated code|obfuscated]]. Held semi-annually, it is described as "celebrating [C's] syntactical opaqueness".<ref>{{cite journalweb |url=http://pcworld.co.nz/pcworld/pcw.nsf/how-to/beyond-the-command-line |access-date=2013-04-07 |title=Beyond the command line |journalwork= [[PC World]] New Zealand| last=Palmer| first= Geoff| date=November 1, 2004| publisher= Fairfax Media, Fairfax New Zealand Limited |url-status=dead |archive-url= https://web.archive.org/web/20130210081342/http://pcworld.co.nz/pcworld/pcw.nsf/how-to/beyond-the-command-line |archive-date=February 10, 2013 }}</ref> The winning code for the 27th contest, held in 2020, was released in July 2020.<ref>{{cite web |url= https://www.ioccc.org/years-spoiler.html |title=Previous IOCCC Winners with spoilers |publisher= International Obfuscated C Code Contest | website= IOCCC.org |access-date=2023-05-01 |publisher=IOCCC}}</ref> Previous contests were held in the years 1984–1996, 1998, 2000, 2001, 2004–2006, 2011–2015 and 2018–2020.
 
Entries are evaluated anonymously by a panel of judges. The judging process is documented in the competition guidelines<ref name= guidelines>{{cite web |url=https://www.ioccc.org/2015/guidelines.txt |title=2015 Guidelines |access-date=2023-05-01 |year=2015 |format=plain text |publisher= International Obfuscated C Code Contest | website= IOCCC.org |access-date=2023-05-01}}</ref> and consists of elimination rounds. By tradition, no information is given about the total number of entries for each competition. Winning entries are awarded with a category, such as "Worst Abuse of the [[C preprocessor]]" or "Most Erratic Behavior", and then announced on the official IOCCC website. The contest states that being announced on the IOCCC website is the reward for winning.
 
==History==
 
The IOCCC was started by [[Landon Curt Noll]] and Larry Bassel in 1984 while employed at National Semiconductor's Genix porting group. The idea for the contest came after they compared notes with each other about some poorly written code that they had to fix, notably the [[Bourne shell]], which used macros to emulate [[ALGOL 68]] syntax, and a buggy version of [[finger (Unix)|finger]] for BSD.<ref>{{cite web |url=https://www.ioccc.org/faq.html |title=The FAQ |publisher= International Obfuscated C Code Contest | website= IOCCC.org| date= |access-date=2023-05-01}}</ref> The contest itself was the topic of a quiz question in the 1993 Computer Bowl.<ref>[{{cite news| url= http://nl.newsbank.com/nl-search/we/Archives?p_product=SJ&s_site=mercurynews&p_multi=SJ&p_theme=realcities&p_action=search&p_maxdocs=200&p_topdoc=1&p_text_direct-0=0EB71B1E74EA9019&p_field_direct-0=document_id&p_perpage=10&p_sort=YMD_date:D&s_trackval=GooglePM "|title= Top Execs Fail To Compute Correctly"].| first= | last= | work= ''[[San Jose Mercury News]]'',| place= California.| date= May 15, 1993.| p.page= 1A.| Viavia= [[Newsbank]].| url-access= {{subscription| requiredurl-status= dead| archiveurl= https://web.archive.org/web/20140808041942/http://nl.newsbank.com/nl-search/we/Archives?p_product=SJ&s_site=mercurynews&p_multi=SJ&p_theme=realcities&p_action=search&p_maxdocs=200&p_topdoc=1&p_text_direct-0=0EB71B1E74EA9019&p_field_direct-0=document_id&p_perpage=10&p_sort=YMD_date:D&s_trackval=GooglePM| archivedate= 2014-08-08| access-date= 2025-08-08}}</ref> After a hiatus of five years starting in 2006, the contest returned in 2011.<ref name=SJMerc11>{{cite web| url= https://www.pcworld.com/article/478306/obfuscated_code_contest_returns.html |title=Obfuscated Code Contest Returns |magazine=[[PC World]]|date=November 15, 2011|last=Jackson|first=Joab| publisher= |access-date=2023-05-01}}</ref>
 
Compared with other programming contests, the IOCCC is described as "not all that serious" by [[Michael Swaine (technical author)|Michael Swaine]], editor of ''[[Dr. Dobb's Journal]]''.<ref>{{cite journal |url=https://www.drdobbs.com/architecture-and-design/there-must-be-contest/207404123 |title=There Must be Contest |first=Michael |last=Swaine |author-link=Michael Swaine (technical author) |journal=[[Dr. Dobb's Journal]]|date=May 1, 2008 |access-date=2023-05-01}}</ref>
Line 51:
==Rules==
 
Each year, the rules of the contest are published on the IOCCC website. All material is published under [[Creative Commons license]] [[Share-alike|BY-SA]] 3.0 Unported.<ref>[{{cite web| url= https://www.ioccc.org/ |title= IOCCC home page,| footer],at= andFooter |publisher= International Obfuscated C Code Contest | website= IOCCC.org| date= | access-date= }} Also in each hint.txt file.</ref> Rules vary from year to year and are posted with a set of guidelines that attempt to convey the spirit of the rules.
 
{{Blockquotequotebox|text=Hacking the contest rules is a tradition.| author= Landon—Landon Curt Noll, 2011<ref name=SJMerc11 />}}
 
The rules are often deliberately written with loopholes[[loophole]]s that contestants are encouraged to find and abuse.<ref name=guidelines /> Entries that take advantage of loopholes can cause the rules for the following year's contest to be adjusted.<ref name=guidelines />
 
==Obfuscations employed==
 
Entries often employ strange or unusual tricks, such as using the [[C preprocessor]] to do things it was not designed to do (in{{efn|In some cases "spectacularly", according to ''Dr. Dobbs'',<ref>{{cite web |url=https://www.drdobbs.com/open-source/code-finessing/193104882?pgno=2 |title=Code Finessing |magazine=[[Dr. Dobb's Journal]]|author last= Spinellis,| first= Diomidis |date=October 5, 2006 |access-date=2023-05-01}}</ref> with one entry creating an 11-bit [[Arithmetic logic unit|ALU]] in the C preprocessor<ref name= "cpp_abuse">[{{cite web| url= https://www.ioccc.org/2004/vik2.hint| title= IOCCC 2004 – Best Abuse of CPP]'' |publisher= International Obfuscated C Code Contest | website= IOCCC.org| Retrieveddate= | first= | last= |access-date= 2023-05-01.}}</ref>),}} or avoiding commonly used constructs in the C programming language in favor of much more obscure ways of achieving the same thing.
 
Contributions have included source code formatted to resemble images, text, etc., after the manner of [[ASCII art]], preprocessor redefinitions to make code harder to read, and [[self-modifying code]]. In several years an entry was submitted that required a new definition of some of the rules for the next year, regarded as a high honor. An example is the world's shortest [[Quine (computing)|self-reproducing program]]. The entry was a program designed to output its own source code, and which had zero bytes of source code. When the program ran, it printed out zero bytes, equivalent to its source code.<ref>{{cite web|year=1994|title=iocc smr| url= https://www.ioccc.org/1994/smr/index.html |access-datepublisher=2025-08-05 International Obfuscated C Code Contest |publisher website= IOCCC.org |format=plain text |date=| access-date=2025-08-05}}</ref>
 
In the effort to take obfuscation to its extremes, contestants have produced programs which skirt around the edges of C standards, or result in constructs which trigger rarely used code path combinations in compilers. As a result, several of the past entries may not compile directly in a modern compiler, and some may cause crashes.
 
==Examples==
Within the code size limit of only a few kilobytes, contestants have managed to do complicated things – a 2004 winner turned out an operating system.<ref>{{cite web| url=https://www.ioccc.org/2004/gavin.hint |title=gavin.hint3 |year=2004 |format=plain text |publisher= International Obfuscated C Code Contest | website= IOCCC.org |access-date=2023-05-01}}</ref>
 
===Toledo Nanochess===
Line 96:
 
===Pi===
Below is a 1988 entry which calculates [[pi]] by looking at its own [[area]]:<ref>{{cite web| url= https://www.ioccc.org/1988/westley.c |title= westley.c| ___locationyear= 5th International Obfuscated C Code Contest 1988 |publisher= International Obfuscated C Code Contest | website= IOCCC.org | access-date= }}</ref>
 
<syntaxhighlight lang="c">
Line 298:
*[[Esoteric programming language]]
 
==Notes and references==
{{notelist}}
<references />
 
==References==
{{reflist}}
 
==External links==