<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Code_golf</id>
	<title>Code golf - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Code_golf"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Code_golf&amp;action=history"/>
	<updated>2026-05-10T06:52:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Code_golf&amp;diff=7181551&amp;oldid=prev</id>
		<title>imported&gt;Citation bot: Add: doi, authors 1-1. Removed parameters. Some additions/deletions were parameter name changes. Upgrade ISBN10 to 13. | Use this bot. Report bugs. | Suggested by Abductive | Category:Articles to be expanded from May 2025 | #UCB_Category 281/784</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Code_golf&amp;diff=7181551&amp;oldid=prev"/>
		<updated>2025-06-03T09:34:21Z</updated>

		<summary type="html">&lt;p&gt;Add: doi, authors 1-1. Removed parameters. Some additions/deletions were parameter name changes. Upgrade ISBN10 to 13. | &lt;a href=&quot;/wiki143/index.php?title=En:WP:UCB&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;En:WP:UCB (page does not exist)&quot;&gt;Use this bot&lt;/a&gt;. &lt;a href=&quot;/wiki143/index.php?title=En:WP:DBUG&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;En:WP:DBUG (page does not exist)&quot;&gt;Report bugs&lt;/a&gt;. | Suggested by Abductive | &lt;a href=&quot;/wiki143/index.php?title=Category:Articles_to_be_expanded_from_May_2025&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:Articles to be expanded from May 2025 (page does not exist)&quot;&gt;Category:Articles to be expanded from May 2025&lt;/a&gt; | #UCB_Category 281/784&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{More citations needed|date=September 2021}}&lt;br /&gt;
{{short description|Recreational computer programming competition}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Code golf&amp;#039;&amp;#039;&amp;#039; is a type of recreational [[computer programming]] [[competition]] in which participants strive to achieve the shortest possible [[source code]] that solves a certain problem.&amp;lt;ref&amp;gt;Code Golf Stack Exchange. [https://codegolf.stackexchange.com/tags/code-golf/info About code-golf]. Retrieved 2021-12-21.&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Cite web|url=https://assist-software.net/blog/introduction-code-golf|title=Introduction to Code-golf {{!}} ASSIST Software Romania|access-date=2023-03-23}}&amp;lt;/ref&amp;gt; Code golf challenges and tournaments may also be named with the programming language used (for example, &amp;#039;&amp;#039;[[Perl]] golf&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
== Etymology ==&lt;br /&gt;
The term &amp;quot;code golf&amp;quot; is derived from the similarity of its goal with that of conventional [[golf]], where participants seek to achieve the lowest possible score, rather than the highest, as is the standard in most sports and game scoring systems. While conventional golf players try to minimize the number of club strokes needed to complete the course, code golfers strive to reduce the number of characters necessary (or keystrokes, to extend the metaphor) to write the program.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
The length of the shortest possible program that produces a given output (in any fixed programming language) is known as the [[Kolmogorov complexity]] of the output, and its mathematical study dates to the work of [[Andrey Kolmogorov]] in 1963. Code golf, however, can be more general than this, as it often specifies a general input-output transformation that must be performed rather than asking for a single output with no input.&lt;br /&gt;
 &lt;br /&gt;
Whilst the term &amp;quot;code golf&amp;quot; was apparently first used in 1999 with [[Perl]],&amp;lt;ref name=&amp;#039;perl-golf-coined&amp;#039;&amp;gt;{{cite newsgroup | author = Greg Bacon | title = Re: Incrementing a value in a slice |message-id= 7imnti$mjh$1@info2.uah.edu | newsgroup = comp.lang.perl.misc | date = 1999-05-28 | url = https://groups.google.com/group/comp.lang.perl.misc/msg/7b97c434492c8d20 | accessdate = 2011-07-12}}&amp;lt;/ref&amp;gt; and later popularised through the use of Perl to write a program that performed [[RSA (algorithm)|RSA]] encryption,&amp;lt;ref name=&amp;#039;rsa&amp;#039;&amp;gt;&lt;br /&gt;
{{cite web | url = http://www.cypherspace.org/rsa/pureperl.html | title = RSA in 5 lines of perl | accessdate = 2011-01-10 | last = Back | first = Adam}}&amp;lt;/ref&amp;gt; a similar informal competition is known to have been popular with earlier [[APL (programming language)|APL]] hackers. The challenging nature of aggressively optimizing for program size has itself long been recognized; for example, a 1962 coding manual for [[Regnecentralen|Regnecentralen&amp;#039;s]] GIER computer notes that &amp;quot;it is a time-consuming sport to code with the least possible number of instructions&amp;quot; and recommends against it for practical programming.&amp;lt;ref name=&amp;quot;GIER&amp;quot;&amp;gt;{{cite book |last1=Andersen |first1=Christian |last2=Gram |first2=Christian |url=http://datamuseum.dk/w/images/b/be/LaerebogI.pdf |title=Lærebog i Kodning for GIER |volume=1 |edition=3 |location=Copenhagen |publisher=Regnecentralen |year=1962 |page=104 |accessdate=2020-05-16 }}&amp;lt;/ref&amp;gt; Today the term has grown to cover a wide variety of languages, which has even triggered the creation of dedicated golfing languages.&lt;br /&gt;
&lt;br /&gt;
== Dedicated golfing languages ==&lt;br /&gt;
Several new languages have been created specifically with code golfing in mind. Examples include GolfScript, Flogscript, Stuck, and Vyxal, which are [[Turing completeness|Turing-complete]] languages that provide constructs for concisely expressing ideas in code. Because golfing languages compete for extreme brevity, their design sacrifices readability, which is important for practical production environments, and therefore they are often [[Esoteric programming languages|esoteric]]. Sometimes, however, a language is designed for a practical purpose but turns out to be suitable for code golf.&lt;br /&gt;
&lt;br /&gt;
An example of GolfScript code to print 1000 digits of [[pi]]:&amp;lt;ref&amp;gt;{{Cite web|url=http://www.golfscript.com/golfscript/examples.html|title=GolfScript Examples|access-date=2023-03-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
;&amp;#039;&amp;#039;&lt;br /&gt;
6666,-2%{2+.2/@*\/10.3??2*+}*&lt;br /&gt;
`1000&amp;lt;~\;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Code golf websites include novel golfing languages created by users to win code golf challenges. Other popular languages include 05AB1E, Husk, Pyth, CJam and Jelly.&lt;br /&gt;
&lt;br /&gt;
== Types of code golf ==&lt;br /&gt;
Some code golf questions, such as those posed on general programming sites, may not require implementation in a specific [[programming language]]. However, this limits the style of problems that it is possible for the problem designers to pose (for example, by limiting the use of certain language features). In addition, the creation of such &amp;quot;open&amp;quot; questions has resulted in the design of code golf specific programming language dialects such as REBMU (a dialect of [[REBOL]]). Both online and live competitions may also include time limits.&lt;br /&gt;
&lt;br /&gt;
== Practical applications ==&lt;br /&gt;
{{Expand section|date=May 2025}}&lt;br /&gt;
In 2019, cryptography researchers Xavier Bonnetain, Léo Perrin and Shizhu Tian used code golf and the closely linked concept of [[Kolmogorov complexity]] to show that the [[S-box]] used in the [[Streebog]] and [[Kuznyechik]] cryptography algorithms was significantly less random than its creators claimed it was.&amp;lt;ref&amp;gt;{{Citation |last1=Bonnetain |first1=Xavier |title=Anomalies and Vector Space Search: Tools for S-Box Analysis |date=2019 |work=Lecture Notes in Computer Science |pages=196–223 |url=https://doi.org/10.1007/978-3-030-34578-5_8 |access-date=2025-05-12 |place=Cham |publisher=Springer International Publishing |isbn=978-3-030-34577-8 |last2=Perrin |first2=Léo |last3=Tian |first3=Shizhu|doi=10.1007/978-3-030-34578-5_8 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
{{Portal|Computer programming}}&lt;br /&gt;
* [[Code poetry]]&lt;br /&gt;
* [[Data compression]]&lt;br /&gt;
* [[Minification (programming)]]&lt;br /&gt;
* [[Perl#Community|Perl pastimes]]&lt;br /&gt;
* [[Kolmogorov complexity]]&lt;br /&gt;
* [[Kata (programming)]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
*[https://codegolf.stackexchange.com CodeGolf.StackExchange.com: Questions and answers on programming puzzles and code golf]&lt;br /&gt;
*[https://esolangs.org/wiki/Golf Golf] on the esoteric programming languages wiki&lt;br /&gt;
*[https://esolangs.org/wiki/Category:Golfing_language List of dedicated golfing languages]&lt;br /&gt;
*[https://codegolf.meta.stackexchange.com/a/8891/88192 List of all languages used 10 times or more on code golf stack exchange, ranked by brevity]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Programming contests]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Citation bot</name></author>
	</entry>
</feed>