Brostro

BrAiNfuCk

Apr 14th, 2019
2,086
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. <!DOCTYPE html>
  3. <html class="client-nojs" lang="en" dir="ltr">
  4. <head>
  5. <meta charset="UTF-8"/>
  6. <title>Brainfuck - Wikipedia</title>
  7. <script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script>
  8. <script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Brainfuck","wgTitle":"Brainfuck","wgCurRevisionId":892262183,"wgRevisionId":892262183,"wgArticleId":4086,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["CS1 French-language sources (fr)","Articles with example C code","All articles with unsourced statements","Articles with unsourced statements from June 2014","Articles with Curlie links","Non-English-based programming languages","Esoteric programming languages","Programming languages created in 1993"],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"Brainfuck","wgRelevantArticleId":4086,"wgRequestId":"XLGfCQpAAEIAAEIz0r0AAABG","wgCSPNonce":false,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgFlaggedRevsParams":{"tags":{}},"wgStableRevisionId":null,"wgBetaFeaturesFeatures":[],"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsReferencePreviews":false,"wgPopupsShouldSendModuleToUser":true,"wgPopupsConflictsWithNavPopupGadget":false,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en","usePageImages":true,"usePageDescriptions":true},"wgMFDisplayWikibaseDescriptions":{"search":true,"nearby":true,"watchlist":true,"tagline":false},"wgRelatedArticles":null,"wgRelatedArticlesUseCirrusSearch":true,"wgRelatedArticlesOnlyUseCirrusSearch":false,"wgWMESchemaEditAttemptStepOversample":false,"wgPoweredByHHVM":true,"wgULSCurrentAutonym":"English","wgNoticeProject":"wikipedia","wgCentralNoticeCookiesToDelete":[],"wgCentralNoticeCategoriesUsingLegacy":["Fundraising","fundraising"],"wgWikibaseItemId":"Q244627","wgScoreNoteLanguages":{"arabic":"العربية","catalan":"català","deutsch":"Deutsch","english":"English","espanol":"español","italiano":"italiano","nederlands":"Nederlands","norsk":"norsk","portugues":"português","suomi":"suomi","svenska":"svenska","vlaams":"West-Vlams"},"wgScoreDefaultNoteLanguage":"nederlands","wgCentralAuthMobileDomain":false,"wgVisualEditorUnsupportedEditParams":["undo","undoafter","veswitched"],"wgEditSubmitButtonLabelPublish":true});mw.loader.state({"ext.gadget.charinsert-styles":"ready","ext.globalCssJs.user.styles":"ready","ext.globalCssJs.site.styles":"ready","site.styles":"ready","noscript":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","ext.globalCssJs.site":"ready","user":"ready","user.options":"ready","user.tokens":"loading","ext.cite.styles":"ready","ext.pygments":"ready","ext.math.styles":"ready","mediawiki.legacy.shared":"ready","mediawiki.legacy.commonPrint":"ready","mediawiki.toc.styles":"ready","wikibase.client.init":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","ext.wikimediaBadges":"ready","ext.3d.styles":"ready","mediawiki.skinning.interface":"ready","skins.vector.styles":"ready"});mw.loader.implement("user.tokens@0tffind",function($,jQuery,require,module){/*@nomin*/mw.user.tokens.set({"editToken":"+\\","patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"});
  9. });RLPAGEMODULES=["ext.cite.ux-enhancements","ext.math.scripts","site","mediawiki.page.startup","mediawiki.page.ready","mediawiki.toc","mediawiki.searchSuggest","ext.gadget.teahouse","ext.gadget.ReferenceTooltips","ext.gadget.watchlist-notice","ext.gadget.DRN-wizard","ext.gadget.charinsert","ext.gadget.refToolbar","ext.gadget.extra-toolbar-buttons","ext.gadget.switcher","ext.centralauth.centralautologin","ext.popups","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.eventlogger","ext.uls.init","ext.uls.compactlinks","ext.uls.interface","ext.quicksurveys.init","ext.centralNotice.geoIP","ext.centralNotice.startUp","skins.vector.js"];mw.loader.load(RLPAGEMODULES);});</script>
  10. <link rel="stylesheet" href="/w/load.php?lang=en&amp;modules=ext.3d.styles%7Cext.cite.styles%7Cext.math.styles%7Cext.pygments%2CwikimediaBadges%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.skinning.interface%7Cmediawiki.toc.styles%7Cskins.vector.styles%7Cwikibase.client.init&amp;only=styles&amp;skin=vector"/>
  11. <script async="" src="/w/load.php?lang=en&amp;modules=startup&amp;only=scripts&amp;skin=vector"></script>
  12. <meta name="ResourceLoaderDynamicStyles" content=""/>
  13. <link rel="stylesheet" href="/w/load.php?lang=en&amp;modules=ext.gadget.charinsert-styles&amp;only=styles&amp;skin=vector"/>
  14. <link rel="stylesheet" href="/w/load.php?lang=en&amp;modules=site.styles&amp;only=styles&amp;skin=vector"/>
  15. <meta name="generator" content="MediaWiki 1.33.0-wmf.25"/>
  16. <meta name="referrer" content="origin"/>
  17. <meta name="referrer" content="origin-when-crossorigin"/>
  18. <meta name="referrer" content="origin-when-cross-origin"/>
  19. <link rel="alternate" href="android-app://org.wikipedia/http/en.m.wikipedia.org/wiki/Brainfuck"/>
  20. <link rel="alternate" type="application/x-wiki" title="Edit this page" href="/w/index.php?title=Brainfuck&amp;action=edit"/>
  21. <link rel="edit" title="Edit this page" href="/w/index.php?title=Brainfuck&amp;action=edit"/>
  22. <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"/>
  23. <link rel="shortcut icon" href="/static/favicon/wikipedia.ico"/>
  24. <link rel="search" type="application/opensearchdescription+xml" href="/w/opensearch_desc.php" title="Wikipedia (en)"/>
  25. <link rel="EditURI" type="application/rsd+xml" href="//en.wikipedia.org/w/api.php?action=rsd"/>
  26. <link rel="license" href="//creativecommons.org/licenses/by-sa/3.0/"/>
  27. <link rel="canonical" href="https://en.wikipedia.org/wiki/Brainfuck"/>
  28. <link rel="dns-prefetch" href="//login.wikimedia.org"/>
  29. <link rel="dns-prefetch" href="//meta.wikimedia.org" />
  30. <!--[if lt IE 9]><script src="/w/load.php?lang=en&amp;modules=html5shiv&amp;only=scripts&amp;skin=vector&amp;sync=1"></script><![endif]-->
  31. </head>
  32. <body class="mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-Brainfuck rootpage-Brainfuck skin-vector action-view">
  33. <div id="mw-page-base" class="noprint"></div>
  34. <div id="mw-head-base" class="noprint"></div>
  35. <div id="content" class="mw-body" role="main">
  36.     <a id="top"></a>
  37.     <div id="siteNotice" class="mw-body-content"><!-- CentralNotice --></div>
  38.     <div class="mw-indicators mw-body-content">
  39. </div>
  40.  
  41.     <h1 id="firstHeading" class="firstHeading" lang="en">Brainfuck</h1>
  42.    
  43.     <div id="bodyContent" class="mw-body-content">
  44.         <div id="siteSub" class="noprint">From Wikipedia, the free encyclopedia</div>
  45.         <div id="contentSub"></div>
  46.        
  47.        
  48.        
  49.         <div id="jump-to-nav"></div>
  50.         <a class="mw-jump-link" href="#mw-head">Jump to navigation</a>
  51.         <a class="mw-jump-link" href="#p-search">Jump to search</a>
  52.         <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-parser-output"><div role="note" class="hatnote navigation-not-searchable">Not to be confused with <a href="/wiki/Brain_Fuck_Scheduler" title="Brain Fuck Scheduler">Brain Fuck Scheduler</a> or <a href="/wiki/Mindfuck_(disambiguation)" class="mw-redirect mw-disambig" title="Mindfuck (disambiguation)">Mindfuck</a>.</div>
  53. <table class="infobox vevent" style="width:22em"><caption class="summary">Brainfuck</caption><tbody><tr><th scope="row"><a href="/wiki/Programming_paradigm" title="Programming paradigm">Paradigm</a></th><td><a href="/wiki/Esoteric_programming_language" title="Esoteric programming language">esoteric</a>, <a href="/wiki/Imperative_programming" title="Imperative programming">imperative</a>, <a href="/wiki/Structured_programming" title="Structured programming">structured</a></td></tr><tr><th scope="row"><a href="/wiki/Software_design" title="Software design">Designed&#160;by</a></th><td>Urban Müller</td></tr><tr><th scope="row">First&#160;appeared</th><td>September 1993</td></tr><tr><th scope="row"><a href="/wiki/Type_system" title="Type system">Typing discipline</a></th><td>typeless</td></tr><tr><th scope="row"><a href="/wiki/Filename_extension" title="Filename extension">Filename extensions</a></th><td>.b, .bf</td></tr><tr><th colspan="2" style="text-align:center;background-color: #eee;">Influenced by</th></tr><tr><td colspan="2" style="text-align:center"><a href="/wiki/P%E2%80%B2%E2%80%B2" title="P′′">P′′</a>, <a href="/wiki/Esoteric_programming_language#FALSE" title="Esoteric programming language">FALSE</a></td></tr></tbody></table>
  54. <p><b>Brainfuck</b> is an <a href="/wiki/Esoteric_programming_language" title="Esoteric programming language">esoteric programming language</a> created in 1993 by <a href="/w/index.php?title=Urban_M%C3%BCller&amp;action=edit&amp;redlink=1" class="new" title="Urban Müller (page does not exist)">Urban Müller</a>, and is notable for its extreme minimalism.
  55. </p><p>The language consists of only eight simple commands and an <a href="/wiki/Instruction_pointer" class="mw-redirect" title="Instruction pointer">instruction pointer</a>.  While it is fully <a href="/wiki/Turing_completeness" title="Turing completeness">Turing complete</a>, it is not intended for practical use, but to challenge and amuse <a href="/wiki/Programmers" class="mw-redirect" title="Programmers">programmers</a>. Brainfuck simply requires one to break commands into microscopic steps.
  56. </p><p>The language's name is a reference to the slang term <i><a href="https://en.wiktionary.org/wiki/brainfuck" class="extiw" title="wikt:brainfuck">brainfuck</a></i>, which refers to things so complicated or unusual that they exceed the limits of one's understanding.
  57. </p>
  58. <div id="toc" class="toc"><input type="checkbox" role="button" id="toctogglecheckbox" class="toctogglecheckbox" style="display:none" /><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2><span class="toctogglespan"><label class="toctogglelabel" for="toctogglecheckbox"></label></span></div>
  59. <ul>
  60. <li class="toclevel-1 tocsection-1"><a href="#History"><span class="tocnumber">1</span> <span class="toctext">History</span></a>
  61. <ul>
  62. <li class="toclevel-2 tocsection-2"><a href="#P′′:_Brainfuck&#39;s_formal_&quot;parent_language&quot;"><span class="tocnumber">1.1</span> <span class="toctext">P′′: Brainfuck's formal "parent language"</span></a></li>
  63. <li class="toclevel-2 tocsection-3"><a href="#The_Infinite_Abacus:_Brainfuck&#39;s_&quot;grand-parent&quot;_language"><span class="tocnumber">1.2</span> <span class="toctext">The Infinite Abacus: Brainfuck's "grand-parent" language</span></a></li>
  64. </ul>
  65. </li>
  66. <li class="toclevel-1 tocsection-4"><a href="#Language_design"><span class="tocnumber">2</span> <span class="toctext">Language design</span></a>
  67. <ul>
  68. <li class="toclevel-2 tocsection-5"><a href="#Commands"><span class="tocnumber">2.1</span> <span class="toctext">Commands</span></a></li>
  69. </ul>
  70. </li>
  71. <li class="toclevel-1 tocsection-6"><a href="#Examples"><span class="tocnumber">3</span> <span class="toctext">Examples</span></a>
  72. <ul>
  73. <li class="toclevel-2 tocsection-7"><a href="#Adding_two_values"><span class="tocnumber">3.1</span> <span class="toctext">Adding two values</span></a></li>
  74. <li class="toclevel-2 tocsection-8"><a href="#Hello_World!"><span class="tocnumber">3.2</span> <span class="toctext">Hello World!</span></a></li>
  75. <li class="toclevel-2 tocsection-9"><a href="#ROT13"><span class="tocnumber">3.3</span> <span class="toctext">ROT13</span></a></li>
  76. </ul>
  77. </li>
  78. <li class="toclevel-1 tocsection-10"><a href="#Portability_issues"><span class="tocnumber">4</span> <span class="toctext">Portability issues</span></a>
  79. <ul>
  80. <li class="toclevel-2 tocsection-11"><a href="#Cell_size"><span class="tocnumber">4.1</span> <span class="toctext">Cell size</span></a></li>
  81. <li class="toclevel-2 tocsection-12"><a href="#Array_size"><span class="tocnumber">4.2</span> <span class="toctext">Array size</span></a></li>
  82. <li class="toclevel-2 tocsection-13"><a href="#End-of-line_code"><span class="tocnumber">4.3</span> <span class="toctext">End-of-line code</span></a></li>
  83. <li class="toclevel-2 tocsection-14"><a href="#End-of-file_behavior"><span class="tocnumber">4.4</span> <span class="toctext">End-of-file behavior</span></a></li>
  84. </ul>
  85. </li>
  86. <li class="toclevel-1 tocsection-15"><a href="#Derivatives"><span class="tocnumber">5</span> <span class="toctext">Derivatives</span></a></li>
  87. <li class="toclevel-1 tocsection-16"><a href="#See_also"><span class="tocnumber">6</span> <span class="toctext">See also</span></a></li>
  88. <li class="toclevel-1 tocsection-17"><a href="#References"><span class="tocnumber">7</span> <span class="toctext">References</span></a></li>
  89. <li class="toclevel-1 tocsection-18"><a href="#External_links"><span class="tocnumber">8</span> <span class="toctext">External links</span></a></li>
  90. </ul>
  91. </div>
  92.  
  93. <h2><span class="mw-headline" id="History">History</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=1" title="Edit section: History">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
  94. <p>In 1992, Urban Müller, a Swiss physics student, took over a small online archive for <a href="/wiki/Amiga" title="Amiga">Amiga</a> software.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">&#91;1&#93;</a></sup> The archive grew more popular, and was soon mirrored around the world. Today, it is the world's largest Amiga archive, known as <a href="/wiki/Aminet" title="Aminet">Aminet</a>.
  95. </p><p>Müller designed Brainfuck with the goal of implementing it with the smallest possible <a href="/wiki/Compiler" title="Compiler">compiler</a>,<sup id="cite_ref-2" class="reference"><a href="#cite_note-2">&#91;2&#93;</a></sup> inspired by the 1024-byte compiler for the <a href="/wiki/Esoteric_programming_language#FALSE" title="Esoteric programming language">FALSE programming language</a>.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3">&#91;3&#93;</a></sup> Müller's original compiler was implemented in machine language and compiled to a binary with a size of 296 bytes. He uploaded the first Brainfuck compiler to Aminet in 1993. The program came with a "Readme" file, which briefly described the language, and challenged the reader "Who can program anything useful with it? <a href="/wiki/Emoticon" title="Emoticon">:)</a>". Müller also included an interpreter and some quite elaborate examples. A second version of the compiler used only 240 bytes.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4">&#91;4&#93;</a></sup>
  96. </p><p>As Aminet grew, the compiler became popular among the Amiga community, and in time it was implemented for other platforms. Several brainfuck compilers have been made smaller than 200 bytes, and one is only 100 bytes.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5">&#91;5&#93;</a></sup>
  97. </p>
  98. <h3><span id="P.E2.80.B2.E2.80.B2:_Brainfuck.27s_formal_.22parent_language.22"></span><span class="mw-headline" id="P′′:_Brainfuck's_formal_&quot;parent_language&quot;">P′′: Brainfuck's formal "parent language"</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=2" title="Edit section: P′′: Brainfuck&#039;s formal &quot;parent language&quot;">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
  99. <p>Except for its two I/O commands, Brainfuck is a minor variation of the formal programming language <a href="/wiki/P%E2%80%B2%E2%80%B2" title="P′′">P′′</a> created by <a href="/wiki/Corrado_B%C3%B6hm" title="Corrado Böhm">Corrado Böhm</a> in 1964, which in turn is explicitly based on the <a href="/wiki/Turing_machine" title="Turing machine">Turing machine</a>.  In fact, using six symbols equivalent to the respective Brainfuck commands <code>+</code>, <code>-</code>, <code>&lt;</code>, <code>&gt;</code>, <code>[</code>, <code>]</code>, Böhm provided an explicit program for each of the basic functions that together serve to compute any <a href="/wiki/Computable_function" title="Computable function">computable function</a>.  So the first "Brainfuck" programs appear in Böhm's 1964 paper &#8211; and they were programs sufficient to prove <a href="/wiki/Turing_completeness" title="Turing completeness">Turing completeness</a>.
  100. </p>
  101. <h3><span id="The_Infinite_Abacus:_Brainfuck.27s_.22grand-parent.22_language"></span><span class="mw-headline" id="The_Infinite_Abacus:_Brainfuck's_&quot;grand-parent&quot;_language">The Infinite Abacus: Brainfuck's "grand-parent" language</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=3" title="Edit section: The Infinite Abacus: Brainfuck&#039;s &quot;grand-parent&quot; language">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
  102. <p>A version with explicit memory addressing rather without stack and a conditional jump was introduced by <a href="/wiki/Joachim_Lambek" title="Joachim Lambek">Joachim Lambek</a> in 1961 under the name of the Infinite Abacus,<sup id="cite_ref-lambek_6-0" class="reference"><a href="#cite_note-lambek-6">&#91;6&#93;</a></sup> consisting of an infinite number of cells and two instructions:
  103. </p>
  104. <ul><li><code>X+</code> (increment cell X)</li>
  105. <li><code>X- else jump T</code> (decrement X if it is positive else jump to T)</li></ul>
  106. <p>He proves the Infinite Abacus can compute any computable recursive function by programming <a href="/wiki/Stephen_Cole_Kleene" title="Stephen Cole Kleene">Kleene</a> set of basic <a href="/wiki/M-recursive_function" class="mw-redirect" title="M-recursive function">μ-recursive function</a>.
  107. </p><p>His machine was simulated by Melzac's machine<sup id="cite_ref-melzak_7-0" class="reference"><a href="#cite_note-melzak-7">&#91;7&#93;</a></sup> modeling computation via arithmetic rather than logic mimicking a human operator moving pebbles on an abacus, hence the requirement that all numbers must be positive. Melzac, whose <a href="/wiki/One_instruction_set_computer" title="One instruction set computer">one instruction set computer</a> is equivalent to an Infinite Abacus, gives programs for multiplication, gcd, n<sup>t</sup> prime number, representation in base b, sorting by magnitude, and shows how to simulate an arbitrary Turing machine.
  108. </p>
  109. <h2><span class="mw-headline" id="Language_design">Language design</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=4" title="Edit section: Language design">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
  110. <p>The language consists of eight <a href="/wiki/Command_(computing)" title="Command (computing)">commands</a>, listed below. A brainfuck program is a sequence of these commands, possibly interspersed with other characters (which are ignored). The commands are executed sequentially, with some exceptions: an <a href="/wiki/Program_Counter" class="mw-redirect" title="Program Counter">instruction pointer</a> begins at the first command, and each command it points to is executed, after which it normally moves forward to the next command. The program terminates when the instruction pointer moves past the last command.
  111. </p><p>The brainfuck language uses a simple machine model consisting of the program and instruction pointer, as well as an array of at least 30,000 <a href="/wiki/Byte" title="Byte">byte</a> cells initialized to zero; a movable <a href="/wiki/Pointer_(computer_programming)" title="Pointer (computer programming)">data pointer</a> (initialized to point to the leftmost byte of the array); and two streams of bytes for input and output (most often connected to a keyboard and a monitor respectively, and using the <a href="/wiki/ASCII" title="ASCII">ASCII</a> character encoding).
  112. </p>
  113. <h3><span class="mw-headline" id="Commands">Commands</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=5" title="Edit section: Commands">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
  114. <p>The eight language commands each consist of a single character:
  115. </p>
  116. <table class="wikitable">
  117.  
  118. <tbody><tr>
  119. <th style="text-align:center;">Character
  120. </th>
  121. <th align="left">Meaning
  122. </th></tr>
  123. <tr>
  124. <td style="text-align:center"><code>&gt;</code>
  125. </td>
  126. <td>increment the <a href="/wiki/Pointer_(computer_programming)" title="Pointer (computer programming)">data pointer</a> (to point to the next cell to the right).
  127. </td></tr>
  128. <tr>
  129. <td style="text-align:center"><code>&lt;</code>
  130. </td>
  131. <td>decrement the data pointer (to point to the next cell to the left).
  132. </td></tr>
  133. <tr>
  134. <td style="text-align:center"><code>+</code>
  135. </td>
  136. <td>increment (increase by one) the byte at the data pointer.
  137. </td></tr>
  138. <tr>
  139. <td style="text-align:center"><code>-</code>
  140. </td>
  141. <td>decrement (decrease by one) the byte at the data pointer.
  142. </td></tr>
  143. <tr>
  144. <td style="text-align:center"><code>.</code>
  145. </td>
  146. <td>output the byte at the data pointer.
  147. </td></tr>
  148. <tr>
  149. <td style="text-align:center"><code>,</code>
  150. </td>
  151. <td>accept one byte of input, storing its value in the byte at the data pointer.
  152. </td></tr>
  153. <tr>
  154. <td style="text-align:center"><code>[</code>
  155. </td>
  156. <td>if the byte at the data pointer is zero, then instead of moving the <a href="/wiki/Program_Counter" class="mw-redirect" title="Program Counter">instruction pointer</a> forward to the next command, <a href="/wiki/Branch_(computer_science)" title="Branch (computer science)">jump</a> it <i>forward</i> to the command after the <i>matching</i> <code>]</code> command.
  157. </td></tr>
  158. <tr>
  159. <td style="text-align:center"><code>]</code>
  160. </td>
  161. <td>if the byte at the data pointer is nonzero, then instead of moving the instruction pointer forward to the next command, jump it <i>back</i> to the command after the <i>matching</i> <code>[</code> command.
  162. </td></tr></tbody></table>
  163. <p>(Alternatively, the <code>]</code> command may instead be translated as an unconditional jump <b>to</b> the corresponding <code>[</code> command, or vice versa; programs will behave the same but will run more slowly, due to unnecessary double searching.)
  164. </p><p><code>[</code> and <code>]</code> match as parentheses usually do: each <code>[</code> matches exactly one <code>]</code> and vice versa, the <code>[</code> comes first, and there can be no unmatched <code>[</code> or <code>]</code> between the two.
  165. </p><p>Brainfuck programs can be translated into <a href="/wiki/C_(programming_language)" title="C (programming language)">C</a> using the following substitutions, assuming <code>ptr</code> is of type <code> char*</code> and has been initialized to point to an array of zeroed bytes:
  166. </p>
  167. <table class="wikitable">
  168.  
  169. <tbody><tr>
  170. <th style="text-align:center;">brainfuck command
  171. </th>
  172. <th style="text-align:left;"><a href="/wiki/C_(programming_language)" title="C (programming language)">C</a> equivalent
  173. </th></tr>
  174. <tr>
  175. <td style="text-align:center;">(Program Start)</td>
  176. <td><code class="mw-highlight" dir="ltr"><span class="kt">char</span> <span class="n">array</span><span class="p">[</span><span class="n">INFINITELY_LARGE_SIZE</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span><span class="mi">0</span><span class="p">};</span></code><br /><code class="mw-highlight" dir="ltr"><span class="kt">char</span> <span class="o">*</span><span class="n">ptr</span><span class="o">=</span><span class="n">array</span><span class="p">;</span></code>
  177. </td></tr>
  178. <tr>
  179. <td style="text-align:center;"><code>&gt;</code></td>
  180. <td><code class="mw-highlight" dir="ltr"><span class="o">++</span><span class="n">ptr</span><span class="p">;</span></code>
  181. </td></tr>
  182. <tr>
  183. <td style="text-align:center;"><code>&lt;</code></td>
  184. <td><code class="mw-highlight" dir="ltr"><span class="o">--</span><span class="n">ptr</span><span class="p">;</span></code>
  185. </td></tr>
  186. <tr>
  187. <td style="text-align:center;"><code>+</code></td>
  188. <td><code class="mw-highlight" dir="ltr"><span class="o">++*</span><span class="n">ptr</span><span class="p">;</span></code>
  189. </td></tr>
  190. <tr>
  191. <td style="text-align:center;"><code>-</code></td>
  192. <td><code class="mw-highlight" dir="ltr"><span class="o">--*</span><span class="n">ptr</span><span class="p">;</span></code>
  193. </td></tr>
  194. <tr>
  195. <td style="text-align:center;"><code>.</code></td>
  196. <td><code class="mw-highlight" dir="ltr"><span class="n">putchar</span><span class="p">(</span><span class="o">*</span><span class="n">ptr</span><span class="p">);</span></code>
  197. </td></tr>
  198. <tr>
  199. <td style="text-align:center;"><code>,</code></td>
  200. <td><code class="mw-highlight" dir="ltr"><span class="o">*</span><span class="n">ptr</span><span class="o">=</span><span class="n">getchar</span><span class="p">();</span></code>
  201. </td></tr>
  202. <tr>
  203. <td style="text-align:center;"><code>[</code></td>
  204. <td><code class="mw-highlight" dir="ltr"><span class="k">while</span> <span class="p">(</span><span class="o">*</span><span class="n">ptr</span><span class="p">)</span> <span class="p">{</span></code>
  205. </td></tr>
  206. <tr>
  207. <td style="text-align:center;"><code>]</code></td>
  208. <td><code class="mw-highlight" dir="ltr"><span class="p">}</span></code>
  209. </td></tr></tbody></table>
  210. <p>As the name suggests, Brainfuck programs tend to be difficult to comprehend. This is partly because any mildly complex task requires a long sequence of commands, and partly it is because the program's text gives no direct indications of the program's <a href="/wiki/State_(computer_science)" title="State (computer science)">state</a>. These, as well as Brainfuck's inefficiency and its limited input/output capabilities, are some of the reasons it is not used for serious programming. Nonetheless, like any Turing complete language, Brainfuck is theoretically capable of computing any computable function or simulating any other computational model, if given access to an unlimited amount of memory.<sup id="cite_ref-8" class="reference"><a href="#cite_note-8">&#91;8&#93;</a></sup> A variety of Brainfuck programs have been written.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9">&#91;9&#93;</a></sup> Although Brainfuck programs, especially complicated ones, are difficult to write, it is quite trivial to write an interpreter for Brainfuck in a more typical language such as C due to its simplicity. There even exist Brainfuck interpreters written in the Brainfuck language itself.<sup id="cite_ref-10" class="reference"><a href="#cite_note-10">&#91;10&#93;</a></sup><sup id="cite_ref-11" class="reference"><a href="#cite_note-11">&#91;11&#93;</a></sup>
  211. </p><p>Brainfuck is an example of a so-called <a href="/wiki/Turing_tarpit" title="Turing tarpit">Turing tarpit</a>: It can be used to write <i>any</i> program, but it is not practical to do so, because Brainfuck provides so little abstraction that the programs get very long or complicated.
  212. </p>
  213. <h2><span class="mw-headline" id="Examples">Examples</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=6" title="Edit section: Examples">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
  214. <h3><span class="mw-headline" id="Adding_two_values">Adding two values</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=7" title="Edit section: Adding two values">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
  215. <p>As a first, simple example, the following code snippet will add the current cell's value to the next cell: Each time the loop is executed, the current cell is decremented, the data pointer moves to the right, that next cell is incremented, and the data pointer moves left again. This sequence is repeated until the starting cell is 0.
  216. </p>
  217. <div class="mw-highlight mw-content-ltr" dir="ltr"><pre><span></span><span class="k">[</span><span class="nb">-</span><span class="nv">&gt;</span><span class="nb">+</span><span class="nv">&lt;</span><span class="k">]</span><span class="c"></span>
  218. </pre></div>
  219. <p>This can be incorporated into a simple addition program as follows:
  220. </p>
  221. <div class="mw-highlight mw-content-ltr" dir="ltr"><pre><span></span><span class="nb">++</span><span class="c">       Cell c0 = 2</span>
  222. <span class="nv">&gt;</span><span class="c"> </span><span class="nb">+++++</span><span class="c">  Cell c1 = 5</span>
  223.  
  224. <span class="k">[</span><span class="c">        Start your loops with your cell pointer on the loop counter (c1 in our case)</span>
  225. <span class="nv">&lt;</span><span class="c"> </span><span class="nb">+</span><span class="c">      Add 1 to c0</span>
  226. <span class="nv">&gt;</span><span class="c"> </span><span class="nb">-</span><span class="c">      Subtract 1 from c1</span>
  227. <span class="k">]</span><span class="c">        End your loops with the cell pointer on the loop counter</span>
  228.  
  229. <span class="c">At this point our program has added 5 to 2 leaving 7 in c0 and 0 in c1</span>
  230. <span class="c">but we cannot output this value to the terminal since it is not ASCII encoded!</span>
  231.  
  232. <span class="c">To display the ASCII character &quot;7&quot; we must add 48 to the value 7</span>
  233. <span class="c">48 = 6 * 8 so let&#39;s use another loop to help us!</span>
  234.  
  235. <span class="nb">++++</span><span class="c"> </span><span class="nb">++++</span><span class="c">  c1 = 8 and this will be our loop counter again</span>
  236. <span class="k">[</span><span class="c"></span>
  237. <span class="nv">&lt;</span><span class="c"> </span><span class="nb">+++</span><span class="c"> </span><span class="nb">+++</span><span class="c">  Add 6 to c0</span>
  238. <span class="nv">&gt;</span><span class="c"> </span><span class="nb">-</span><span class="c">        Subtract 1 from c1</span>
  239. <span class="k">]</span><span class="c"></span>
  240. <span class="nv">&lt;</span><span class="c"> </span><span class="nt">.</span><span class="c">        Print out c0 which has the value 55 which translates to &quot;7&quot;!</span>
  241. </pre></div>
  242. <h3><span id="Hello_World.21"></span><span class="mw-headline" id="Hello_World!">Hello World!</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=8" title="Edit section: Hello World!">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
  243. <p>The following program prints <a href="/wiki/Hello_world_program" class="mw-redirect" title="Hello world program">"Hello World!"</a> and a newline to the screen:
  244. </p>
  245. <div class="mw-highlight mw-content-ltr" dir="ltr"><pre><span></span><span class="k">[</span><span class="c"> This program prints &quot;Hello World!&quot; and a newline to the screen</span><span class="nt">,</span><span class="c"> its</span>
  246. <span class="c">  length is 106 active command characters</span><span class="nt">.</span><span class="c"> </span><span class="k">[</span><span class="c">It is not the shortest</span><span class="nt">.</span><span class="k">]</span><span class="c"></span>
  247.  
  248. <span class="c">  This loop is an &quot;initial comment loop&quot;</span><span class="nt">,</span><span class="c"> a simple way of adding a comment</span>
  249. <span class="c">  to a BF program such that you don&#39;t have to worry about any command</span>
  250. <span class="c">  characters</span><span class="nt">.</span><span class="c"> Any &quot;</span><span class="nt">.</span><span class="c">&quot;</span><span class="nt">,</span><span class="c"> &quot;</span><span class="nt">,</span><span class="c">&quot;</span><span class="nt">,</span><span class="c"> &quot;</span><span class="nb">+</span><span class="c">&quot;</span><span class="nt">,</span><span class="c"> &quot;</span><span class="nb">-</span><span class="c">&quot;</span><span class="nt">,</span><span class="c"> &quot;</span><span class="nv">&lt;</span><span class="c">&quot; and &quot;</span><span class="nv">&gt;</span><span class="c">&quot; characters are simply</span>
  251. <span class="c">  ignored</span><span class="nt">,</span><span class="c"> the &quot;</span><span class="k">[</span><span class="c">&quot; and &quot;</span><span class="k">]</span><span class="c">&quot; characters just have to be balanced</span><span class="nt">.</span><span class="c"> This</span>
  252. <span class="c">  loop and the commands it contains are ignored because the current cell</span>
  253. <span class="c">  defaults to a value of 0; the 0 value causes this loop to be skipped</span><span class="nt">.</span><span class="c"></span>
  254. <span class="k">]</span><span class="c"></span>
  255. <span class="nb">++++++++</span><span class="c">               Set Cell #0 to 8</span>
  256. <span class="k">[</span><span class="c"></span>
  257. <span class="c">    </span><span class="nv">&gt;</span><span class="nb">++++</span><span class="c">               Add 4 to Cell #1; this will always set Cell #1 to 4</span>
  258. <span class="c">    </span><span class="k">[</span><span class="c">                   as the cell will be cleared by the loop</span>
  259. <span class="c">        </span><span class="nv">&gt;</span><span class="nb">++</span><span class="c">             Add 2 to Cell #2</span>
  260. <span class="c">        </span><span class="nv">&gt;</span><span class="nb">+++</span><span class="c">            Add 3 to Cell #3</span>
  261. <span class="c">        </span><span class="nv">&gt;</span><span class="nb">+++</span><span class="c">            Add 3 to Cell #4</span>
  262. <span class="c">        </span><span class="nv">&gt;</span><span class="nb">+</span><span class="c">              Add 1 to Cell #5</span>
  263. <span class="c">        </span><span class="nv">&lt;&lt;&lt;&lt;</span><span class="nb">-</span><span class="c">           Decrement the loop counter in Cell #1</span>
  264. <span class="c">    </span><span class="k">]</span><span class="c">                   Loop till Cell #1 is zero; number of iterations is 4</span>
  265. <span class="c">    </span><span class="nv">&gt;</span><span class="nb">+</span><span class="c">                  Add 1 to Cell #2</span>
  266. <span class="c">    </span><span class="nv">&gt;</span><span class="nb">+</span><span class="c">                  Add 1 to Cell #3</span>
  267. <span class="c">    </span><span class="nv">&gt;</span><span class="nb">-</span><span class="c">                  Subtract 1 from Cell #4</span>
  268. <span class="c">    </span><span class="nv">&gt;&gt;</span><span class="nb">+</span><span class="c">                 Add 1 to Cell #6</span>
  269. <span class="c">    </span><span class="k">[</span><span class="nv">&lt;</span><span class="k">]</span><span class="c">                 Move back to the first zero cell you find; this will</span>
  270. <span class="c">                        be Cell #1 which was cleared by the previous loop</span>
  271. <span class="c">    </span><span class="nv">&lt;</span><span class="nb">-</span><span class="c">                  Decrement the loop Counter in Cell #0</span>
  272. <span class="k">]</span><span class="c">                       Loop till Cell #0 is zero; number of iterations is 8</span>
  273.  
  274. <span class="c">The result of this is:</span>
  275. <span class="c">Cell No :   0   1   2   3   4   5   6</span>
  276. <span class="c">Contents:   0   0  72 104  88  32   8</span>
  277. <span class="c">Pointer :   ^</span>
  278.  
  279. <span class="nv">&gt;&gt;</span><span class="nt">.</span><span class="c">                     Cell #2 has value 72 which is &#39;H&#39;</span>
  280. <span class="nv">&gt;</span><span class="nb">---</span><span class="nt">.</span><span class="c">                   Subtract 3 from Cell #3 to get 101 which is &#39;e&#39;</span>
  281. <span class="nb">+++++++</span><span class="nt">..</span><span class="nb">+++</span><span class="nt">.</span><span class="c">           Likewise for &#39;llo&#39; from Cell #3</span>
  282. <span class="nv">&gt;&gt;</span><span class="nt">.</span><span class="c">                     Cell #5 is 32 for the space</span>
  283. <span class="nv">&lt;</span><span class="nb">-</span><span class="nt">.</span><span class="c">                     Subtract 1 from Cell #4 for 87 to give a &#39;W&#39;</span>
  284. <span class="nv">&lt;</span><span class="nt">.</span><span class="c">                      Cell #3 was set to &#39;o&#39; from the end of &#39;Hello&#39;</span>
  285. <span class="nb">+++</span><span class="nt">.</span><span class="nb">------</span><span class="nt">.</span><span class="nb">--------</span><span class="nt">.</span><span class="c">    Cell #3 for &#39;rl&#39; and &#39;d&#39;</span>
  286. <span class="nv">&gt;&gt;</span><span class="nb">+</span><span class="nt">.</span><span class="c">                    Add 1 to Cell #5 gives us an exclamation point</span>
  287. <span class="nv">&gt;</span><span class="nb">++</span><span class="nt">.</span><span class="c">                    And finally a newline from Cell #6</span>
  288. </pre></div>
  289. <p>For "readability", this code has been spread across many lines and blanks and comments have been added. Brainfuck ignores all characters except the eight commands <code>+-&lt;&gt;[],.</code> so no special syntax for comments is needed (as long as the comments do not contain the command characters). The code could just as well have been written as:
  290. </p>
  291. <div class="mw-highlight mw-content-ltr" dir="ltr"><pre><span></span><span class="nb">++++++++</span><span class="k">[</span><span class="nv">&gt;</span><span class="nb">++++</span><span class="k">[</span><span class="nv">&gt;</span><span class="nb">++</span><span class="nv">&gt;</span><span class="nb">+++</span><span class="nv">&gt;</span><span class="nb">+++</span><span class="nv">&gt;</span><span class="nb">+</span><span class="nv">&lt;&lt;&lt;&lt;</span><span class="nb">-</span><span class="k">]</span><span class="nv">&gt;</span><span class="nb">+</span><span class="nv">&gt;</span><span class="nb">+</span><span class="nv">&gt;</span><span class="nb">-</span><span class="nv">&gt;&gt;</span><span class="nb">+</span><span class="k">[</span><span class="nv">&lt;</span><span class="k">]</span><span class="nv">&lt;</span><span class="nb">-</span><span class="k">]</span><span class="nv">&gt;&gt;</span><span class="nt">.</span><span class="nv">&gt;</span><span class="nb">---</span><span class="nt">.</span><span class="nb">+++++++</span><span class="nt">..</span><span class="nb">+++</span><span class="nt">.</span><span class="nv">&gt;&gt;</span><span class="nt">.</span><span class="nv">&lt;</span><span class="nb">-</span><span class="nt">.</span><span class="nv">&lt;</span><span class="nt">.</span><span class="nb">+++</span><span class="nt">.</span><span class="nb">------</span><span class="nt">.</span><span class="nb">--------</span><span class="nt">.</span><span class="nv">&gt;&gt;</span><span class="nb">+</span><span class="nt">.</span><span class="nv">&gt;</span><span class="nb">++</span><span class="nt">.</span><span class="c"></span>
  292. </pre></div>
  293. <h3><span class="mw-headline" id="ROT13">ROT13</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=9" title="Edit section: ROT13">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
  294. <p>This program enciphers its input with the <a href="/wiki/ROT13" title="ROT13">ROT13</a> cipher. To do this, it must map characters A-M (<a href="/wiki/ASCII" title="ASCII">ASCII</a> 65-77) to N-Z (78-90), and vice versa. Also it must map a-m (97-109) to n-z (110-122) and vice versa. It must map all other characters to themselves; it reads characters one at a time and outputs their enciphered equivalents until it reads an EOF (here assumed to be represented as either -1 or "no change"), at which point the program terminates.
  295. </p><p>The basic approach used is as follows. Calling the input character <i>x</i>, divide <i>x</i>-1 by 32, keeping quotient and remainder. Unless the quotient is 2 or 3, just output <i>x</i>, having kept a copy of it during the division. If the quotient is 2 or 3, divide the remainder ((<i>x</i>-1) modulo 32) by 13; if the quotient here is 0, output <i>x</i>+13; if 1, output <i>x</i>-13; if 2, output <i>x</i>.
  296. </p><p>Regarding the division algorithm, when dividing <i>y</i> by <i>z</i> to get a quotient <i>q</i> and remainder <i>r</i>, there is an outer loop which sets <i>q</i> and <i>r</i> first to the quotient and remainder of 1/<i>z</i>, then to those of 2/<i>z</i>, and so on; after it has executed <i>y</i> times, this outer loop terminates, leaving <i>q</i> and <i>r</i> set to the quotient and remainder of <i>y</i>/<i>z</i>. (The dividend <i>y</i> is used as a diminishing counter that controls how many times this loop is executed.) Within the loop, there is code to increment <i>r</i> and decrement <i>y</i>, which is usually sufficient; however, every <i>z</i>th time through the outer loop, it is necessary to zero <i>r</i> and increment <i>q</i>. This is done with a diminishing counter set to the divisor <i>z</i>; each time through the outer loop, this counter is decremented, and when it reaches zero, it is refilled by moving the value from <i>r</i> back into it.
  297. </p>
  298. <div class="mw-highlight mw-content-ltr" dir="ltr"><pre><span></span><span class="c"> </span>
  299. <span class="nb">-</span><span class="nt">,</span><span class="nb">+</span><span class="k">[</span><span class="c">                         Read first character and start outer character reading loop</span>
  300. <span class="c">    </span><span class="nb">-</span><span class="k">[</span><span class="c">                       Skip forward if character is 0</span>
  301. <span class="c">        </span><span class="nv">&gt;&gt;</span><span class="nb">++++</span><span class="k">[</span><span class="nv">&gt;</span><span class="nb">++++++++</span><span class="nv">&lt;</span><span class="nb">-</span><span class="k">]</span><span class="c">  Set up divisor (32) for division loop</span>
  302. <span class="c">                               (MEMORY LAYOUT: dividend copy remainder divisor quotient zero zero)</span>
  303. <span class="c">        </span><span class="nv">&lt;</span><span class="nb">+</span><span class="nv">&lt;</span><span class="nb">-</span><span class="k">[</span><span class="c">                Set up dividend (x minus 1) and enter division loop</span>
  304. <span class="c">            </span><span class="nv">&gt;</span><span class="nb">+</span><span class="nv">&gt;</span><span class="nb">+</span><span class="nv">&gt;</span><span class="nb">-</span><span class="k">[</span><span class="nv">&gt;&gt;&gt;</span><span class="k">]</span><span class="c">      Increase copy and remainder / reduce divisor / Normal case: skip forward</span>
  305. <span class="c">            </span><span class="nv">&lt;</span><span class="k">[[</span><span class="nv">&gt;</span><span class="nb">+</span><span class="nv">&lt;</span><span class="nb">-</span><span class="k">]</span><span class="nv">&gt;&gt;</span><span class="nb">+</span><span class="nv">&gt;</span><span class="k">]</span><span class="c">    Special case: move remainder back to divisor and increase quotient</span>
  306. <span class="c">            </span><span class="nv">&lt;&lt;&lt;&lt;&lt;</span><span class="nb">-</span><span class="c">           Decrement dividend</span>
  307. <span class="c">        </span><span class="k">]</span><span class="c">                    End division loop</span>
  308. <span class="c">    </span><span class="k">]</span><span class="nv">&gt;&gt;&gt;</span><span class="k">[</span><span class="nb">-</span><span class="k">]</span><span class="nb">+</span><span class="c">                 End skip loop; zero former divisor and reuse space for a flag</span>
  309. <span class="c">    </span><span class="nv">&gt;</span><span class="nb">--</span><span class="k">[</span><span class="nb">-</span><span class="k">[</span><span class="nv">&lt;</span><span class="nb">-</span><span class="nv">&gt;</span><span class="nb">+++</span><span class="k">[</span><span class="nb">-</span><span class="k">]]]</span><span class="nv">&lt;</span><span class="k">[</span><span class="c">         Zero that flag unless quotient was 2 or 3; zero quotient; check flag</span>
  310. <span class="c">        </span><span class="nb">++++++++++++</span><span class="nv">&lt;</span><span class="k">[</span><span class="c">       If flag then set up divisor (13) for second division loop</span>
  311. <span class="c">                               (MEMORY LAYOUT: zero copy dividend divisor remainder quotient zero zero)</span>
  312. <span class="c">            </span><span class="nv">&gt;</span><span class="nb">-</span><span class="k">[</span><span class="nv">&gt;</span><span class="nb">+</span><span class="nv">&gt;&gt;</span><span class="k">]</span><span class="c">         Reduce divisor; Normal case: increase remainder</span>
  313. <span class="c">            </span><span class="nv">&gt;</span><span class="k">[</span><span class="nb">+</span><span class="k">[</span><span class="nv">&lt;</span><span class="nb">+</span><span class="nv">&gt;</span><span class="nb">-</span><span class="k">]</span><span class="nv">&gt;</span><span class="nb">+</span><span class="nv">&gt;&gt;</span><span class="k">]</span><span class="c">   Special case: increase remainder / move it back to divisor / increase quotient</span>
  314. <span class="c">            </span><span class="nv">&lt;&lt;&lt;&lt;&lt;</span><span class="nb">-</span><span class="c">           Decrease dividend</span>
  315. <span class="c">        </span><span class="k">]</span><span class="c">                    End division loop</span>
  316. <span class="c">        </span><span class="nv">&gt;&gt;</span><span class="k">[</span><span class="nv">&lt;</span><span class="nb">+</span><span class="nv">&gt;</span><span class="nb">-</span><span class="k">]</span><span class="c">             Add remainder back to divisor to get a useful 13</span>
  317. <span class="c">        </span><span class="nv">&gt;</span><span class="k">[</span><span class="c">                   Skip forward if quotient was 0</span>
  318. <span class="c">            </span><span class="nb">-</span><span class="k">[</span><span class="c">               Decrement quotient and skip forward if quotient was 1</span>
  319. <span class="c">                </span><span class="nb">-</span><span class="nv">&lt;&lt;</span><span class="k">[</span><span class="nb">-</span><span class="k">]</span><span class="nv">&gt;&gt;</span><span class="c">     Zero quotient and divisor if quotient was 2</span>
  320. <span class="c">            </span><span class="k">]</span><span class="nv">&lt;&lt;</span><span class="k">[</span><span class="nv">&lt;&lt;</span><span class="nb">-</span><span class="nv">&gt;&gt;</span><span class="nb">-</span><span class="k">]</span><span class="nv">&gt;&gt;</span><span class="c">    Zero divisor and subtract 13 from copy if quotient was 1</span>
  321. <span class="c">        </span><span class="k">]</span><span class="nv">&lt;&lt;</span><span class="k">[</span><span class="nv">&lt;&lt;</span><span class="nb">+</span><span class="nv">&gt;&gt;</span><span class="nb">-</span><span class="k">]</span><span class="c">          Zero divisor and add 13 to copy if quotient was 0</span>
  322. <span class="c">    </span><span class="k">]</span><span class="c">                        End outer skip loop (jump to here if ((character minus 1)/32) was not 2 or 3)</span>
  323. <span class="c">    </span><span class="nv">&lt;</span><span class="k">[</span><span class="nb">-</span><span class="k">]</span><span class="c">                     Clear remainder from first division if second division was skipped</span>
  324. <span class="c">    </span><span class="nv">&lt;</span><span class="nt">.</span><span class="k">[</span><span class="nb">-</span><span class="k">]</span><span class="c">                    Output ROT13ed character from copy and clear it</span>
  325. <span class="c">    </span><span class="nv">&lt;</span><span class="nb">-</span><span class="nt">,</span><span class="nb">+</span><span class="c">                     Read next character</span>
  326. <span class="k">]</span><span class="c">                            End character reading loop</span>
  327. </pre></div>
  328. <h2><span class="mw-headline" id="Portability_issues">Portability issues</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=10" title="Edit section: Portability issues">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
  329. <p>Partly because Urban Müller did not write a thorough language specification, the many subsequent brainfuck interpreters and compilers have come to use slightly different dialects of brainfuck.
  330. </p>
  331. <h3><span class="mw-headline" id="Cell_size">Cell size</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=11" title="Edit section: Cell size">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
  332. <p>In the classic distribution, the cells are of 8-bit size (cells are bytes), and this is still the most common size. However, to read non-textual data, a brainfuck program may need to distinguish an <a href="/wiki/End-of-file" title="End-of-file">end-of-file</a> condition from any possible byte value; thus 16-bit cells have also been used. Some implementations have used 32-bit cells, 64-bit cells, or <a href="/wiki/Bignum" class="mw-redirect" title="Bignum">bignum</a> cells with practically unlimited range, but programs that use this extra range are likely to be slow, since storing the value <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML"  alttext="{\displaystyle n}">
  333.  <semantics>
  334.    <mrow class="MJX-TeXAtom-ORD">
  335.      <mstyle displaystyle="true" scriptlevel="0">
  336.        <mi>n</mi>
  337.      </mstyle>
  338.    </mrow>
  339.    <annotation encoding="application/x-tex">{\displaystyle n}</annotation>
  340.  </semantics>
  341. </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="n"/></span> into a cell requires <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML"  alttext="{\displaystyle O(n)}">
  342.  <semantics>
  343.    <mrow class="MJX-TeXAtom-ORD">
  344.      <mstyle displaystyle="true" scriptlevel="0">
  345.        <mi>O</mi>
  346.        <mo stretchy="false">(</mo>
  347.        <mi>n</mi>
  348.        <mo stretchy="false">)</mo>
  349.      </mstyle>
  350.    </mrow>
  351.    <annotation encoding="application/x-tex">{\displaystyle O(n)}</annotation>
  352.  </semantics>
  353. </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/34109fe397fdcff370079185bfdb65826cb5565a" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.838ex; width:4.977ex; height:2.843ex;" alt="O(n)"/></span> time as a cell's value may only be changed by incrementing and decrementing.
  354. </p><p>In all these variants, the <code>,</code> and <code>.</code> commands still read and write data in bytes. In most of them, the cells wrap around, i.e. incrementing a cell which holds its maximal value (with the <code>+</code> command) will bring it to its minimal value and vice versa. The exceptions are implementations which are distant from the underlying hardware, implementations that use bignums, and implementations that try to enforce portability.
  355. </p><p>It is usually easy to write brainfuck programs that do not ever cause integer wraparound or overflow, and therefore don't depend on cell size. Generally this means avoiding increment of +255 (unsigned 8-bit wraparound), or avoiding overstepping the boundaries of [-128, +127] (signed 8-bit wraparound) (since there are no comparison operators, a program cannot distinguish between a signed and unsigned <a href="/wiki/Two%27s_complement" title="Two&#39;s complement">two's complement</a> fixed-bit-size cell and negativeness of numbers is a matter of interpretation). For more details on integer wraparound, see the <a href="/wiki/Integer_overflow" title="Integer overflow">Integer overflow</a> article.
  356. </p>
  357. <h3><span class="mw-headline" id="Array_size">Array size</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=12" title="Edit section: Array size">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
  358. <p>In the classic distribution, the array has 30,000 cells, and the pointer begins at the leftmost cell. Even more cells are needed to store things like the millionth <a href="/wiki/Fibonacci_number" title="Fibonacci number">Fibonacci number</a>, and the easiest way to make the language Turing complete is to make the array unlimited on the right.
  359. </p><p>A few implementations<sup id="cite_ref-12" class="reference"><a href="#cite_note-12">&#91;12&#93;</a></sup> extend the array to the left as well; this is an uncommon feature, and therefore portable brainfuck programs do not depend on it.
  360. </p><p>When the pointer moves outside the bounds of the array, some implementations will give an error message, some will try to extend the array dynamically, some will not notice and will produce <a href="/wiki/Undefined_behavior" title="Undefined behavior">undefined behavior</a>, and a few will move the pointer to the opposite end of the array. Some tradeoffs are involved: expanding the array dynamically to the right is the most user-friendly approach and is good for memory-hungry programs, but it carries a speed penalty. If a fixed-size array is used it is helpful to make it very large, or better yet let the user set the size. Giving an error message for bounds violations is very useful for debugging but even that carries a speed penalty unless it can be handled by the operating system's memory protections.
  361. </p>
  362. <h3><span class="mw-headline" id="End-of-line_code">End-of-line code</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=13" title="Edit section: End-of-line code">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
  363. <p>Different operating systems (and sometimes different programming environments) use subtly different versions of ASCII. The most important difference is in the code used for the end of a line of text. MS-DOS and Microsoft Windows use a <a href="/wiki/Newline#Representations" title="Newline">CRLF</a>, i.e. a 13 followed by a 10, in most contexts. UNIX and its descendants (including GNU/Linux and Mac OS X) and Amigas use just 10, and older Macs use just 13. It would be difficult if brainfuck programs had to be rewritten for different operating systems. However, a unified standard was easy to create. Urban Müller's compiler and his example programs use 10, on both input and output; so do a large majority of existing brainfuck programs; and 10 is also more convenient to use than CRLF. Thus, brainfuck implementations should make sure that brainfuck programs that assume newline = 10 will run properly; many do so, but some do not.
  364. </p><p>This assumption is also consistent with most of the world's sample code for <a href="/wiki/C_(programming_language)" title="C (programming language)">C</a> and other languages, in that they use '\n', or 10, for their newlines. On systems that use CRLF line endings, the C standard library transparently remaps "\n" to "\r\n" on output and "\r\n" to "\n" on input for streams not opened in binary mode.
  365. </p>
  366. <h3><span class="mw-headline" id="End-of-file_behavior">End-of-file behavior</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=14" title="Edit section: End-of-file behavior">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
  367. <p>The behavior of the <code>,</code> command when an <a href="/wiki/End-of-file" title="End-of-file">end-of-file</a> condition has been encountered varies. Some implementations set the cell at the pointer to 0, some set it to the C constant EOF (in practice this is usually -1), some leave the cell's value unchanged. There is no real consensus; arguments for the three behaviors are as follows.
  368. </p><p>Setting the cell to 0 avoids the use of negative numbers, and makes it marginally more concise to write a loop that reads characters until EOF occurs. This is a language extension devised by Panu Kalliokoski.
  369. </p><p>Setting the cell to -1 allows EOF to be distinguished from any byte value (if the cells are larger than bytes), which is necessary for reading non-textual data; also, it is the behavior of the C translation of <code>,</code> given in Müller's readme file. However, it is not obvious that those C translations are to be taken as normative.
  370. </p><p>Leaving the cell's value unchanged is the behavior of Urban Müller's brainfuck compiler. This behavior can easily coexist with either of the others; for instance, a program that assumes EOF = 0 can set the cell to 0 before each <code>,</code> command, and will then work correctly on implementations that do either EOF = 0 or EOF = "no change". It is so easy to accommodate the "no change" behavior that any brainfuck programmer interested in portability should do so.
  371. </p>
  372. <h2><span class="mw-headline" id="Derivatives">Derivatives</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=15" title="Edit section: Derivatives">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
  373. <p>Many people have created brainfuck equivalents (languages with commands that directly map to brainfuck) or brainfuck derivatives (languages that extend its behavior or map it into new semantic territory).
  374. </p><p>Some examples:
  375. </p>
  376. <ul><li><b>Pi</b>, which maps brainfuck into errors in individual digits of <a href="/wiki/Pi" title="Pi">Pi</a>.<sup id="cite_ref-13" class="reference"><a href="#cite_note-13">&#91;13&#93;</a></sup></li>
  377. <li><b>VerboseFuck</b>, which looks like a traditional programming language, only what appears as parameters or expressions are actually parts of longer commands that cannot be altered.<sup class="noprint Inline-Template Template-Fact" style="white-space:nowrap;">&#91;<i><a href="/wiki/Wikipedia:Citation_needed" title="Wikipedia:Citation needed"><span title="This seems to be something someone just made up as a joke last month, not mentioned in any independent reliable source. (June 2014)">citation needed</span></a></i>&#93;</sup></li>
  378. <li><b>DerpPlusPlus</b>, in which the commands are replaced with words such as 'HERP', 'DERP', 'GIGITY', etc.<sup id="cite_ref-14" class="reference"><a href="#cite_note-14">&#91;14&#93;</a></sup></li>
  379. <li><b>Ook!</b>, which maps brainfuck's eight commands to two-word combinations of "Ook.", "Ook?", and "Ook!", jokingly designed to be "writable and readable by orang-utans" according to its creator, a reference to <a href="/wiki/The_Librarian_(Discworld)#Librarian" class="mw-redirect" title="The Librarian (Discworld)">the orang-utan Librarian</a> in the novels of <a href="/wiki/Terry_Pratchett" title="Terry Pratchett">Terry Pratchett</a>.<sup id="cite_ref-15" class="reference"><a href="#cite_note-15">&#91;15&#93;</a></sup><sup id="cite_ref-Paloque-Bergès2009_16-0" class="reference"><a href="#cite_note-Paloque-Bergès2009-16">&#91;16&#93;</a></sup></li>
  380. <li><b>Ternary</b>, similar in concept to Ook! but instead consisting of permutations of the ASCII characters 0, 1, and 2.<sup id="cite_ref-17" class="reference"><a href="#cite_note-17">&#91;17&#93;</a></sup></li>
  381. <li><b>BodyFuck</b>, a BrainFuck implementation based on a <a href="/wiki/Gesture_recognition" title="Gesture recognition">gesture-controlled system</a> so that programmer's movements are captured by a video camera and converted into the 8 possible characters.<sup id="cite_ref-18" class="reference"><a href="#cite_note-18">&#91;18&#93;</a></sup></li></ul>
  382. <p>However, there are also unnamed minor variants (or dialects), possibly formed as a result of inattention, of which some of the more common are:<sup class="noprint Inline-Template Template-Fact" style="white-space:nowrap;">&#91;<i><a href="/wiki/Wikipedia:Citation_needed" title="Wikipedia:Citation needed"><span title="This claim needs references to reliable sources. (June 2014)">citation needed</span></a></i>&#93;</sup>
  383. </p>
  384. <ul><li>forbidding, rather than ignoring, any non-command characters in brainfuck programs</li>
  385. <li>introducing a comment marker which comments out the rest of the line</li>
  386. <li>various alterations of the loop semantics, sometimes destroying Turing completeness</li>
  387. <li>requiring a special character to mark the end of the program</li></ul>
  388. <h2><span class="mw-headline" id="See_also">See also</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=16" title="Edit section: See also">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
  389. <ul><li><a href="/wiki/JSFuck" title="JSFuck">JSFuck</a> – an esoteric JavaScript programming language with a very limited set of characters</li></ul>
  390. <h2><span class="mw-headline" id="References">References</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=17" title="Edit section: References">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
  391. <div class="reflist columns references-column-width" style="-moz-column-width: 30em; -webkit-column-width: 30em; column-width: 30em; list-style-type: decimal;">
  392. <ol class="references">
  393. <li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="http://de4.aminet.net/docs/misc/5000.txt">"Aminet hits 5000 files"</a>. Urban Müller. 1993-09-24<span class="reference-accessdate">. Retrieved <span class="nowrap">2015-05-03</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=Aminet+hits+5000+files&amp;rft.pub=Urban+M%C3%BCller&amp;rft.date=1993-09-24&amp;rft_id=http%3A%2F%2Fde4.aminet.net%2Fdocs%2Fmisc%2F5000.txt&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><style data-mw-deduplicate="TemplateStyles:r886058088">.mw-parser-output cite.citation{font-style:inherit}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation .cs1-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Wikisource-logo.svg/12px-Wikisource-logo.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:inherit;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{font-size:100%}.mw-parser-output .cs1-maint{display:none;color:#33aa33;margin-left:0.3em}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration,.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}</style></span>
  394. </li>
  395. <li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="http://www.muppetlabs.com/~breadbox/bf/">"The Brainfuck Programming Language"</a>. Muppetlabs.com<span class="reference-accessdate">. Retrieved <span class="nowrap">2013-10-30</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=The+Brainfuck+Programming+Language&amp;rft.pub=Muppetlabs.com&amp;rft_id=http%3A%2F%2Fwww.muppetlabs.com%2F~breadbox%2Fbf%2F&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  396. </li>
  397. <li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="http://strlen.com/false/index.html">"Wouter's Wiki&#160;: False Language"</a>. Strlen.com. 2013-08-03<span class="reference-accessdate">. Retrieved <span class="nowrap">2013-10-30</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=Wouter%27s+Wiki+%3A+False+Language&amp;rft.pub=Strlen.com&amp;rft.date=2013-08-03&amp;rft_id=http%3A%2F%2Fstrlen.com%2Ffalse%2Findex.html&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  398. </li>
  399. <li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20051106213924/http://www.aminet.net/package.php?package=dev%2Flang%2Fbrainfuck-2.lha">"dev/lang/brainfuck-2.lha"</a>. Aminet. Archived from <a rel="nofollow" class="external text" href="http://www.aminet.net/package.php?package=dev/lang/brainfuck-2.lha">the original</a> on 2005-11-06<span class="reference-accessdate">. Retrieved <span class="nowrap">2013-10-30</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=dev%2Flang%2Fbrainfuck-2.lha&amp;rft.pub=Aminet&amp;rft_id=http%3A%2F%2Fwww.aminet.net%2Fpackage.php%3Fpackage%3Ddev%2Flang%2Fbrainfuck-2.lha&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  400. </li>
  401. <li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="https://github.com/peterferrie/brainfuck">"BRAINFCK IN 100 BYTES!"</a>. github.com<span class="reference-accessdate">. Retrieved <span class="nowrap">2016-03-22</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=BRAINFCK+IN+100+BYTES%21&amp;rft.pub=github.com&amp;rft_id=https%3A%2F%2Fgithub.com%2Fpeterferrie%2Fbrainfuck&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  402. </li>
  403. <li id="cite_note-lambek-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-lambek_6-0">^</a></b></span> <span class="reference-text"><cite class="citation web">J. Lambek (1961). <a rel="nofollow" class="external text" href="https://cms.math.ca/10.4153/CMB-1961-032-6">"How to program an infinite abacus"</a>. <i>Canadian Mathematical Bulletin</i>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=unknown&amp;rft.jtitle=Canadian+Mathematical+Bulletin&amp;rft.atitle=How+to+program+an+infinite+abacus&amp;rft.date=1961&amp;rft.au=J.+Lambek&amp;rft_id=https%3A%2F%2Fcms.math.ca%2F10.4153%2FCMB-1961-032-6&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  404. </li>
  405. <li id="cite_note-melzak-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-melzak_7-0">^</a></b></span> <span class="reference-text"><cite class="citation web">Z. A. Melzak (1961). <a rel="nofollow" class="external text" href="https://cms.math.ca/10.4153/CMB-1961-031-9">"An informal arithmetical approach to computability and computation"</a>. <i>Canadian Mathematical Bulletin</i>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=unknown&amp;rft.jtitle=Canadian+Mathematical+Bulletin&amp;rft.atitle=An+informal+arithmetical+approach+to+computability+and+computation&amp;rft.date=1961&amp;rft.au=Z.+A.+Melzak&amp;rft_id=https%3A%2F%2Fcms.math.ca%2F10.4153%2FCMB-1961-031-9&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  406. </li>
  407. <li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="http://www.iwriteiam.nl/Ha_bf_Turing.html">"BF is Turing-complete"</a>. Iwriteiam.nl<span class="reference-accessdate">. Retrieved <span class="nowrap">2013-10-30</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=BF+is+Turing-complete&amp;rft.pub=Iwriteiam.nl&amp;rft_id=http%3A%2F%2Fwww.iwriteiam.nl%2FHa_bf_Turing.html&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  408. </li>
  409. <li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="http://esoteric.sange.fi/brainfuck/bf-source/prog/">"Index of /brainfuck/bf-source/prog"</a>. Esoteric.sange.fi. 2002-01-22<span class="reference-accessdate">. Retrieved <span class="nowrap">2013-10-30</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=Index+of+%2Fbrainfuck%2Fbf-source%2Fprog&amp;rft.pub=Esoteric.sange.fi&amp;rft.date=2002-01-22&amp;rft_id=http%3A%2F%2Fesoteric.sange.fi%2Fbrainfuck%2Fbf-source%2Fprog%2F&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  410. </li>
  411. <li id="cite_note-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-10">^</a></b></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="http://www.iwriteiam.nl/Ha_bf_inter.html">"BF interpreter written in BF"</a>. Iwriteiam.nl<span class="reference-accessdate">. Retrieved <span class="nowrap">2013-10-30</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=BF+interpreter+written+in+BF&amp;rft.pub=Iwriteiam.nl&amp;rft_id=http%3A%2F%2Fwww.iwriteiam.nl%2FHa_bf_inter.html&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  412. </li>
  413. <li id="cite_note-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-11">^</a></b></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="http://www.hevanet.com/cristofd/dbfi.b">"brainfuck interpreter"</a>. Daniel B. Cristofani.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=brainfuck+interpreter&amp;rft.pub=Daniel+B.+Cristofani&amp;rft_id=http%3A%2F%2Fwww.hevanet.com%2Fcristofd%2Fdbfi.b&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  414. </li>
  415. <li id="cite_note-12"><span class="mw-cite-backlink"><b><a href="#cite_ref-12">^</a></b></span> <span class="reference-text"><cite class="citation web">Bolognani, Andrea. <a rel="nofollow" class="external text" href="http://kiyuko.org/software/beef">"Beef –"</a>. Kiyuko.org<span class="reference-accessdate">. Retrieved <span class="nowrap">2013-10-30</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=Beef+%E2%80%93&amp;rft.pub=Kiyuko.org&amp;rft.aulast=Bolognani&amp;rft.aufirst=Andrea&amp;rft_id=http%3A%2F%2Fkiyuko.org%2Fsoftware%2Fbeef&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  416. </li>
  417. <li id="cite_note-13"><span class="mw-cite-backlink"><b><a href="#cite_ref-13">^</a></b></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="https://esolangs.org/wiki/Pi">"Pi - Esolang"</a>. <i>esolangs.org</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2019-03-19</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=unknown&amp;rft.jtitle=esolangs.org&amp;rft.atitle=Pi+-+Esolang&amp;rft_id=https%3A%2F%2Fesolangs.org%2Fwiki%2FPi&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  418. </li>
  419. <li id="cite_note-14"><span class="mw-cite-backlink"><b><a href="#cite_ref-14">^</a></b></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="https://github.com/TheRaz/DerpPlusPlus">"TheRaz/DerpPlusPlus"</a>. Github.com<span class="reference-accessdate">. Retrieved <span class="nowrap">2015-04-08</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=TheRaz%2FDerpPlusPlus&amp;rft.pub=Github.com&amp;rft_id=https%3A%2F%2Fgithub.com%2FTheRaz%2FDerpPlusPlus&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  420. </li>
  421. <li id="cite_note-15"><span class="mw-cite-backlink"><b><a href="#cite_ref-15">^</a></b></span> <span class="reference-text"><cite class="citation web">Morgan-Mar, David (2009-03-21). <a rel="nofollow" class="external text" href="http://www.dangermouse.net/esoteric/ook.html">"Ook!"</a>. <i>DM's Esoteric Programming Languages</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2014-06-28</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=unknown&amp;rft.jtitle=DM%27s+Esoteric+Programming+Languages&amp;rft.atitle=Ook%21&amp;rft.date=2009-03-21&amp;rft.aulast=Morgan-Mar&amp;rft.aufirst=David&amp;rft_id=http%3A%2F%2Fwww.dangermouse.net%2Fesoteric%2Fook.html&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  422. </li>
  423. <li id="cite_note-Paloque-Bergès2009-16"><span class="mw-cite-backlink"><b><a href="#cite_ref-Paloque-Bergès2009_16-0">^</a></b></span> <span class="reference-text"><cite class="citation book">Paloque-Bergès, Camille (2009). <a rel="nofollow" class="external text" href="https://books.google.com/books?id=HQt00bhlSqsC&amp;pg=PA73"><i>Poétique des codes sur le réseau informatique</i></a> (in French). Paris: <a href="/wiki/%C3%89ditions_des_archives_contemporaines" title="Éditions des archives contemporaines">Éditions des archives contemporaines</a>. p.&#160;73. <a href="/wiki/International_Standard_Book_Number" title="International Standard Book Number">ISBN</a>&#160;<a href="/wiki/Special:BookSources/978-2-914610-70-4" title="Special:BookSources/978-2-914610-70-4">978-2-914610-70-4</a>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=Po%C3%A9tique+des+codes+sur+le+r%C3%A9seau+informatique&amp;rft.place=Paris&amp;rft.pages=73&amp;rft.pub=%C3%89ditions+des+archives+contemporaines&amp;rft.date=2009&amp;rft.isbn=978-2-914610-70-4&amp;rft.aulast=Paloque-Berg%C3%A8s&amp;rft.aufirst=Camille&amp;rft_id=https%3A%2F%2Fbooks.google.com%2Fbooks%3Fid%3DHQt00bhlSqsC%26pg%3DPA73&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  424. </li>
  425. <li id="cite_note-17"><span class="mw-cite-backlink"><b><a href="#cite_ref-17">^</a></b></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="https://github.com/zerosum0x0/ternary">"Ternary Programming Language"</a>. <i>Ternary Programming Language</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2015-06-14</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=unknown&amp;rft.jtitle=Ternary+Programming+Language&amp;rft.atitle=Ternary+Programming+Language&amp;rft_id=https%3A%2F%2Fgithub.com%2Fzerosum0x0%2Fternary&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  426. </li>
  427. <li id="cite_note-18"><span class="mw-cite-backlink"><b><a href="#cite_ref-18">^</a></b></span> <span class="reference-text"><cite class="citation web">Hanselmann, Nik. <a rel="nofollow" class="external text" href="http://nik.works/bodyfuck/">"There is no hardware"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2 February</span> 2016</span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=There+is+no+hardware.&amp;rft.aulast=Hanselmann&amp;rft.aufirst=Nik&amp;rft_id=http%3A%2F%2Fnik.works%2Fbodyfuck%2F&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ABrainfuck" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886058088"/></span>
  428. </li>
  429. </ol></div>
  430. <h2><span class="mw-headline" id="External_links">External links</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Brainfuck&amp;action=edit&amp;section=18" title="Edit section: External links">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
  431. <ul><li><a rel="nofollow" class="external text" href="https://curlie.org/Computers/Programming/Languages/Brainfuck">Brainfuck</a> at <a href="/wiki/Curlie" class="mw-redirect" title="Curlie">Curlie</a></li>
  432. <li><a rel="nofollow" class="external text" href="http://www.bf.doleczek.pl/">Brainfuck</a> interpreter on-line in <a href="/wiki/JavaScript" title="JavaScript">JavaScript</a> with collection of programs</li>
  433. <li><a rel="nofollow" class="external text" href="https://github.com/zk-phi/bfbuilder">Brainfuck IDE</a> - A brainfuck development environment with interactive debugger</li>
  434. <li><a rel="nofollow" class="external text" href="http://tunn.us/bf/generator.php">Brainfuck generator</a> - A text to brainfuck generator</li>
  435. <li><a rel="nofollow" class="external text" href="https://github.com/pablojorge/brainfuck">Brainfuck collection</a> of Interpreters and scripts</li>
  436. <li><a rel="nofollow" class="external text" href="https://www.vanheusden.com/misc/blog/2016-05-19_brainfuck_cobol_compiler.php">Brainfuck</a> to COBOL, C, ASM, PL/1, ... compiler</li></ul>
  437. <!--
  438. NewPP limit report
  439. Parsed by mw1346
  440. Cached time: 20190413083301
  441. Cache expiry: 2592000
  442. Dynamic content: false
  443. CPU time usage: 0.336 seconds
  444. Real time usage: 0.442 seconds
  445. Preprocessor visited node count: 1518/1000000
  446. Preprocessor generated node count: 0/1500000
  447. Post‐expand include size: 30624/2097152 bytes
  448. Template argument size: 1790/2097152 bytes
  449. Highest expansion depth: 11/40
  450. Expensive parser function count: 3/500
  451. Unstrip recursion depth: 1/20
  452. Unstrip post‐expand size: 68736/5000000 bytes
  453. Number of Wikibase entities loaded: 1/400
  454. Lua time usage: 0.156/10.000 seconds
  455. Lua memory usage: 4 MB/50 MB
  456. -->
  457. <!--
  458. Transclusion expansion time report (%,ms,calls,template)
  459. 100.00%  342.488      1 -total
  460. 47.71%  163.386      1 Template:Reflist
  461. 37.45%  128.247     17 Template:Cite_web
  462. 16.60%   56.859      2 Template:Citation_needed
  463. 15.87%   54.368      1 Template:Infobox_programming_language
  464. 14.50%   49.653      2 Template:Fix
  465. 13.65%   46.748      1 Template:Infobox
  466. 10.56%   36.164      1 Template:Distinguish
  467.  8.37%   28.679      4 Template:Category_handler
  468.  4.97%   17.027      2 Template:Delink
  469. -->
  470.  
  471. <!-- Saved in parser cache with key enwiki:pcache:idhash:4086-0!canonical!math=5 and timestamp 20190413083355 and revision id 892262183
  472. -->
  473. </div><noscript><img src="//en.wikipedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" title="" width="1" height="1" style="border: none; position: absolute;" /></noscript></div>
  474.        
  475.         <div class="printfooter">Retrieved from "<a dir="ltr" href="https://en.wikipedia.org/w/index.php?title=Brainfuck&amp;oldid=892262183">https://en.wikipedia.org/w/index.php?title=Brainfuck&amp;oldid=892262183</a>"</div>
  476.        
  477.         <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Help:Category" title="Help:Category">Categories</a>: <ul><li><a href="/wiki/Category:Non-English-based_programming_languages" title="Category:Non-English-based programming languages">Non-English-based programming languages</a></li><li><a href="/wiki/Category:Esoteric_programming_languages" title="Category:Esoteric programming languages">Esoteric programming languages</a></li><li><a href="/wiki/Category:Programming_languages_created_in_1993" title="Category:Programming languages created in 1993">Programming languages created in 1993</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-hidden">Hidden categories: <ul><li><a href="/wiki/Category:CS1_French-language_sources_(fr)" title="Category:CS1 French-language sources (fr)">CS1 French-language sources (fr)</a></li><li><a href="/wiki/Category:Articles_with_example_C_code" title="Category:Articles with example C code">Articles with example C code</a></li><li><a href="/wiki/Category:All_articles_with_unsourced_statements" title="Category:All articles with unsourced statements">All articles with unsourced statements</a></li><li><a href="/wiki/Category:Articles_with_unsourced_statements_from_June_2014" title="Category:Articles with unsourced statements from June 2014">Articles with unsourced statements from June 2014</a></li><li><a href="/wiki/Category:Articles_with_Curlie_links" title="Category:Articles with Curlie links">Articles with Curlie links</a></li></ul></div></div>
  478.        
  479.         <div class="visualClear"></div>
  480.        
  481.     </div>
  482. </div>
  483.  
  484.         <div id="mw-navigation">
  485.             <h2>Navigation menu</h2>
  486.             <div id="mw-head">
  487.                                     <div id="p-personal" role="navigation" aria-labelledby="p-personal-label">
  488.                         <h3 id="p-personal-label">Personal tools</h3>
  489.                         <ul>
  490.                             <li id="pt-anonuserpage">Not logged in</li><li id="pt-anontalk"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [n]" accesskey="n">Talk</a></li><li id="pt-anoncontribs"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [y]" accesskey="y">Contributions</a></li><li id="pt-createaccount"><a href="/w/index.php?title=Special:CreateAccount&amp;returnto=Brainfuck" title="You are encouraged to create an account and log in; however, it is not mandatory">Create account</a></li><li id="pt-login"><a href="/w/index.php?title=Special:UserLogin&amp;returnto=Brainfuck" title="You&#039;re encouraged to log in; however, it&#039;s not mandatory. [o]" accesskey="o">Log in</a></li>                      </ul>
  491.                     </div>
  492.                                     <div id="left-navigation">
  493.                                         <div id="p-namespaces" role="navigation" class="vectorTabs" aria-labelledby="p-namespaces-label">
  494.                         <h3 id="p-namespaces-label">Namespaces</h3>
  495.                         <ul>
  496.                             <li id="ca-nstab-main" class="selected"><span><a href="/wiki/Brainfuck" title="View the content page [c]" accesskey="c">Article</a></span></li><li id="ca-talk"><span><a href="/wiki/Talk:Brainfuck" rel="discussion" title="Discussion about the content page [t]" accesskey="t">Talk</a></span></li>                      </ul>
  497.                     </div>
  498.                                         <div id="p-variants" role="navigation" class="vectorMenu emptyPortlet" aria-labelledby="p-variants-label">
  499.                                                 <input type="checkbox" class="vectorMenuCheckbox" aria-labelledby="p-variants-label" />
  500.                         <h3 id="p-variants-label">
  501.                             <span>Variants</span>
  502.                         </h3>
  503.                         <ul class="menu">
  504.                                                     </ul>
  505.                     </div>
  506.                                     </div>
  507.                 <div id="right-navigation">
  508.                                         <div id="p-views" role="navigation" class="vectorTabs" aria-labelledby="p-views-label">
  509.                         <h3 id="p-views-label">Views</h3>
  510.                         <ul>
  511.                             <li id="ca-view" class="collapsible selected"><span><a href="/wiki/Brainfuck">Read</a></span></li><li id="ca-edit" class="collapsible"><span><a href="/w/index.php?title=Brainfuck&amp;action=edit" title="Edit this page [e]" accesskey="e">Edit</a></span></li><li id="ca-history" class="collapsible"><span><a href="/w/index.php?title=Brainfuck&amp;action=history" title="Past revisions of this page [h]" accesskey="h">View history</a></span></li>                     </ul>
  512.                     </div>
  513.                                         <div id="p-cactions" role="navigation" class="vectorMenu emptyPortlet" aria-labelledby="p-cactions-label">
  514.                         <input type="checkbox" class="vectorMenuCheckbox" aria-labelledby="p-cactions-label" />
  515.                         <h3 id="p-cactions-label"><span>More</span></h3>
  516.                         <ul class="menu">
  517.                                                     </ul>
  518.                     </div>
  519.                                         <div id="p-search" role="search">
  520.                         <h3>
  521.                             <label for="searchInput">Search</label>
  522.                         </h3>
  523.                         <form action="/w/index.php" id="searchform">
  524.                             <div id="simpleSearch">
  525.                                 <input type="search" name="search" placeholder="Search Wikipedia" title="Search Wikipedia [f]" accesskey="f" id="searchInput"/><input type="hidden" value="Special:Search" name="title"/><input type="submit" name="fulltext" value="Search" title="Search Wikipedia for this text" id="mw-searchButton" class="searchButton mw-fallbackSearchButton"/><input type="submit" name="go" value="Go" title="Go to a page with this exact name if it exists" id="searchButton" class="searchButton"/>                            </div>
  526.                         </form>
  527.                     </div>
  528.                                     </div>
  529.             </div>
  530.             <div id="mw-panel">
  531.                 <div id="p-logo" role="banner"><a class="mw-wiki-logo" href="/wiki/Main_Page" title="Visit the main page"></a></div>
  532.                         <div class="portal" role="navigation" id="p-navigation" aria-labelledby="p-navigation-label">
  533.             <h3 id="p-navigation-label">Navigation</h3>
  534.             <div class="body">
  535.                                 <ul>
  536.                     <li id="n-mainpage-description"><a href="/wiki/Main_Page" title="Visit the main page [z]" accesskey="z">Main page</a></li><li id="n-contents"><a href="/wiki/Portal:Contents" title="Guides to browsing Wikipedia">Contents</a></li><li id="n-featuredcontent"><a href="/wiki/Portal:Featured_content" title="Featured content – the best of Wikipedia">Featured content</a></li><li id="n-currentevents"><a href="/wiki/Portal:Current_events" title="Find background information on current events">Current events</a></li><li id="n-randompage"><a href="/wiki/Special:Random" title="Load a random article [x]" accesskey="x">Random article</a></li><li id="n-sitesupport"><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=C13_en.wikipedia.org&amp;uselang=en" title="Support us">Donate to Wikipedia</a></li><li id="n-shoplink"><a href="//shop.wikimedia.org" title="Visit the Wikipedia store">Wikipedia store</a></li>               </ul>
  537.                             </div>
  538.         </div>
  539.             <div class="portal" role="navigation" id="p-interaction" aria-labelledby="p-interaction-label">
  540.             <h3 id="p-interaction-label">Interaction</h3>
  541.             <div class="body">
  542.                                 <ul>
  543.                     <li id="n-help"><a href="/wiki/Help:Contents" title="Guidance on how to use and edit Wikipedia">Help</a></li><li id="n-aboutsite"><a href="/wiki/Wikipedia:About" title="Find out about Wikipedia">About Wikipedia</a></li><li id="n-portal"><a href="/wiki/Wikipedia:Community_portal" title="About the project, what you can do, where to find things">Community portal</a></li><li id="n-recentchanges"><a href="/wiki/Special:RecentChanges" title="A list of recent changes in the wiki [r]" accesskey="r">Recent changes</a></li><li id="n-contactpage"><a href="//en.wikipedia.org/wiki/Wikipedia:Contact_us" title="How to contact Wikipedia">Contact page</a></li>             </ul>
  544.                             </div>
  545.         </div>
  546.             <div class="portal" role="navigation" id="p-tb" aria-labelledby="p-tb-label">
  547.             <h3 id="p-tb-label">Tools</h3>
  548.             <div class="body">
  549.                                 <ul>
  550.                     <li id="t-whatlinkshere"><a href="/wiki/Special:WhatLinksHere/Brainfuck" title="List of all English Wikipedia pages containing links to this page [j]" accesskey="j">What links here</a></li><li id="t-recentchangeslinked"><a href="/wiki/Special:RecentChangesLinked/Brainfuck" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k">Related changes</a></li><li id="t-upload"><a href="/wiki/Wikipedia:File_Upload_Wizard" title="Upload files [u]" accesskey="u">Upload file</a></li><li id="t-specialpages"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q">Special pages</a></li><li id="t-permalink"><a href="/w/index.php?title=Brainfuck&amp;oldid=892262183" title="Permanent link to this revision of the page">Permanent link</a></li><li id="t-info"><a href="/w/index.php?title=Brainfuck&amp;action=info" title="More information about this page">Page information</a></li><li id="t-wikibase"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q244627" title="Link to connected data repository item [g]" accesskey="g">Wikidata item</a></li><li id="t-cite"><a href="/w/index.php?title=Special:CiteThisPage&amp;page=Brainfuck&amp;id=892262183" title="Information on how to cite this page">Cite this page</a></li>                </ul>
  551.                             </div>
  552.         </div>
  553.             <div class="portal" role="navigation" id="p-coll-print_export" aria-labelledby="p-coll-print_export-label">
  554.             <h3 id="p-coll-print_export-label">Print/export</h3>
  555.             <div class="body">
  556.                                 <ul>
  557.                     <li id="coll-create_a_book"><a href="/w/index.php?title=Special:Book&amp;bookcmd=book_creator&amp;referer=Brainfuck">Create a book</a></li><li id="coll-download-as-rdf2latex"><a href="/w/index.php?title=Special:ElectronPdf&amp;page=Brainfuck&amp;action=show-download-screen">Download as PDF</a></li><li id="t-print"><a href="/w/index.php?title=Brainfuck&amp;printable=yes" title="Printable version of this page [p]" accesskey="p">Printable version</a></li>                </ul>
  558.                             </div>
  559.         </div>
  560.             <div class="portal" role="navigation" id="p-lang" aria-labelledby="p-lang-label">
  561.             <h3 id="p-lang-label">Languages</h3>
  562.             <div class="body">
  563.                                 <ul>
  564.                     <li class="interlanguage-link interwiki-ast"><a href="https://ast.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Asturian" lang="ast" hreflang="ast" class="interlanguage-link-target">Asturianu</a></li><li class="interlanguage-link interwiki-ca"><a href="https://ca.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Catalan" lang="ca" hreflang="ca" class="interlanguage-link-target">Català</a></li><li class="interlanguage-link interwiki-cs"><a href="https://cs.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Czech" lang="cs" hreflang="cs" class="interlanguage-link-target">Čeština</a></li><li class="interlanguage-link interwiki-da"><a href="https://da.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Danish" lang="da" hreflang="da" class="interlanguage-link-target">Dansk</a></li><li class="interlanguage-link interwiki-de"><a href="https://de.wikipedia.org/wiki/Brainfuck" title="Brainfuck – German" lang="de" hreflang="de" class="interlanguage-link-target">Deutsch</a></li><li class="interlanguage-link interwiki-et"><a href="https://et.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Estonian" lang="et" hreflang="et" class="interlanguage-link-target">Eesti</a></li><li class="interlanguage-link interwiki-es"><a href="https://es.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Spanish" lang="es" hreflang="es" class="interlanguage-link-target">Español</a></li><li class="interlanguage-link interwiki-eo"><a href="https://eo.wikipedia.org/wiki/Brainfuck_(programlingvo)" title="Brainfuck (programlingvo) – Esperanto" lang="eo" hreflang="eo" class="interlanguage-link-target">Esperanto</a></li><li class="interlanguage-link interwiki-eu"><a href="https://eu.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Basque" lang="eu" hreflang="eu" class="interlanguage-link-target">Euskara</a></li><li class="interlanguage-link interwiki-fa"><a href="https://fa.wikipedia.org/wiki/%D8%A8%D8%B1%DB%8C%D9%86%E2%80%8C%D9%81%D8%A7%DA%A9" title="برین‌فاک – Persian" lang="fa" hreflang="fa" class="interlanguage-link-target">فارسی</a></li><li class="interlanguage-link interwiki-fr"><a href="https://fr.wikipedia.org/wiki/Brainfuck" title="Brainfuck – French" lang="fr" hreflang="fr" class="interlanguage-link-target">Français</a></li><li class="interlanguage-link interwiki-ko"><a href="https://ko.wikipedia.org/wiki/%EB%B8%8C%EB%A0%88%EC%9D%B8%ED%8D%BD" title="브레인퍽 – Korean" lang="ko" hreflang="ko" class="interlanguage-link-target">한국어</a></li><li class="interlanguage-link interwiki-id"><a href="https://id.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Indonesian" lang="id" hreflang="id" class="interlanguage-link-target">Bahasa Indonesia</a></li><li class="interlanguage-link interwiki-is"><a href="https://is.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Icelandic" lang="is" hreflang="is" class="interlanguage-link-target">Íslenska</a></li><li class="interlanguage-link interwiki-it"><a href="https://it.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Italian" lang="it" hreflang="it" class="interlanguage-link-target">Italiano</a></li><li class="interlanguage-link interwiki-he"><a href="https://he.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Hebrew" lang="he" hreflang="he" class="interlanguage-link-target">עברית</a></li><li class="interlanguage-link interwiki-hu"><a href="https://hu.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Hungarian" lang="hu" hreflang="hu" class="interlanguage-link-target">Magyar</a></li><li class="interlanguage-link interwiki-ms"><a href="https://ms.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Malay" lang="ms" hreflang="ms" class="interlanguage-link-target">Bahasa Melayu</a></li><li class="interlanguage-link interwiki-nl"><a href="https://nl.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Dutch" lang="nl" hreflang="nl" class="interlanguage-link-target">Nederlands</a></li><li class="interlanguage-link interwiki-ja"><a href="https://ja.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Japanese" lang="ja" hreflang="ja" class="interlanguage-link-target">日本語</a></li><li class="interlanguage-link interwiki-no"><a href="https://no.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Norwegian" lang="no" hreflang="no" class="interlanguage-link-target">Norsk</a></li><li class="interlanguage-link interwiki-pa"><a href="https://pa.wikipedia.org/wiki/%E0%A8%AC%E0%A9%8D%E0%A8%B0%E0%A9%87%E0%A8%A8%E0%A8%AB%E0%A8%BC%E0%A9%B1%E0%A8%95" title="ਬ੍ਰੇਨਫ਼ੱਕ – Punjabi" lang="pa" hreflang="pa" class="interlanguage-link-target">ਪੰਜਾਬੀ</a></li><li class="interlanguage-link interwiki-pl"><a href="https://pl.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Polish" lang="pl" hreflang="pl" class="interlanguage-link-target">Polski</a></li><li class="interlanguage-link interwiki-pt"><a href="https://pt.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Portuguese" lang="pt" hreflang="pt" class="interlanguage-link-target">Português</a></li><li class="interlanguage-link interwiki-ro"><a href="https://ro.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Romanian" lang="ro" hreflang="ro" class="interlanguage-link-target">Română</a></li><li class="interlanguage-link interwiki-ru"><a href="https://ru.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Russian" lang="ru" hreflang="ru" class="interlanguage-link-target">Русский</a></li><li class="interlanguage-link interwiki-sk"><a href="https://sk.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Slovak" lang="sk" hreflang="sk" class="interlanguage-link-target">Slovenčina</a></li><li class="interlanguage-link interwiki-sl"><a href="https://sl.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Slovenian" lang="sl" hreflang="sl" class="interlanguage-link-target">Slovenščina</a></li><li class="interlanguage-link interwiki-sr"><a href="https://sr.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Serbian" lang="sr" hreflang="sr" class="interlanguage-link-target">Српски / srpski</a></li><li class="interlanguage-link interwiki-fi"><a href="https://fi.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Finnish" lang="fi" hreflang="fi" class="interlanguage-link-target">Suomi</a></li><li class="interlanguage-link interwiki-sv"><a href="https://sv.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Swedish" lang="sv" hreflang="sv" class="interlanguage-link-target">Svenska</a></li><li class="interlanguage-link interwiki-th"><a href="https://th.wikipedia.org/wiki/%E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B2%E0%B9%80%E0%B8%9A%E0%B8%A3%E0%B8%99%E0%B8%9F%E0%B8%B1%E0%B8%81" title="ภาษาเบรนฟัก – Thai" lang="th" hreflang="th" class="interlanguage-link-target">ไทย</a></li><li class="interlanguage-link interwiki-tg"><a href="https://tg.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Tajik" lang="tg" hreflang="tg" class="interlanguage-link-target">Тоҷикӣ</a></li><li class="interlanguage-link interwiki-tr"><a href="https://tr.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Turkish" lang="tr" hreflang="tr" class="interlanguage-link-target">Türkçe</a></li><li class="interlanguage-link interwiki-uk"><a href="https://uk.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Ukrainian" lang="uk" hreflang="uk" class="interlanguage-link-target">Українська</a></li><li class="interlanguage-link interwiki-vi"><a href="https://vi.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Vietnamese" lang="vi" hreflang="vi" class="interlanguage-link-target">Tiếng Việt</a></li><li class="interlanguage-link interwiki-zh"><a href="https://zh.wikipedia.org/wiki/Brainfuck" title="Brainfuck – Chinese" lang="zh" hreflang="zh" class="interlanguage-link-target">中文</a></li>             </ul>
  565.                 <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q244627#sitelinks-wikipedia" title="Edit interlanguage links" class="wbc-editpage">Edit links</a></span></div>            </div>
  566.         </div>
  567.                 </div>
  568.         </div>
  569.                 <div id="footer" role="contentinfo">
  570.                         <ul id="footer-info">
  571.                                 <li id="footer-info-lastmod"> This page was last edited on 13 April 2019, at 08:33<span class="anonymous-show">&#160;(UTC)</span>.</li>
  572.                                 <li id="footer-info-copyright">Text is available under the <a rel="license" href="//en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License">Creative Commons Attribution-ShareAlike License</a><a rel="license" href="//creativecommons.org/licenses/by-sa/3.0/" style="display:none;"></a>;
  573. additional terms may apply.  By using this site, you agree to the <a href="//foundation.wikimedia.org/wiki/Terms_of_Use">Terms of Use</a> and <a href="//foundation.wikimedia.org/wiki/Privacy_policy">Privacy Policy</a>. Wikipedia® is a registered trademark of the <a href="//www.wikimediafoundation.org/">Wikimedia Foundation, Inc.</a>, a non-profit organization.</li>
  574.                             </ul>
  575.                         <ul id="footer-places">
  576.                                 <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Privacy_policy" class="extiw" title="wmf:Privacy policy">Privacy policy</a></li>
  577.                                 <li id="footer-places-about"><a href="/wiki/Wikipedia:About" title="Wikipedia:About">About Wikipedia</a></li>
  578.                                 <li id="footer-places-disclaimer"><a href="/wiki/Wikipedia:General_disclaimer" title="Wikipedia:General disclaimer">Disclaimers</a></li>
  579.                                 <li id="footer-places-contact"><a href="//en.wikipedia.org/wiki/Wikipedia:Contact_us">Contact Wikipedia</a></li>
  580.                                 <li id="footer-places-developers"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/How_to_contribute">Developers</a></li>
  581.                                 <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Cookie_statement">Cookie statement</a></li>
  582.                                 <li id="footer-places-mobileview"><a href="//en.m.wikipedia.org/w/index.php?title=Brainfuck&amp;mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li>
  583.                             </ul>
  584.                                         <ul id="footer-icons" class="noprint">
  585.                                         <li id="footer-copyrightico">
  586.                         <a href="https://wikimediafoundation.org/"><img src="/static/images/wikimedia-button.png" srcset="/static/images/wikimedia-button-1.5x.png 1.5x, /static/images/wikimedia-button-2x.png 2x" width="88" height="31" alt="Wikimedia Foundation"/></a>                 </li>
  587.                                         <li id="footer-poweredbyico">
  588.                         <a href="//www.mediawiki.org/"><img src="/static/images/poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" srcset="/static/images/poweredby_mediawiki_132x47.png 1.5x, /static/images/poweredby_mediawiki_176x62.png 2x" width="88" height="31"/></a>                    </li>
  589.                                     </ul>
  590.                         <div style="clear: both;"></div>
  591.         </div>
  592.        
  593.  
  594. <script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgPageParseReport":{"limitreport":{"cputime":"0.336","walltime":"0.442","ppvisitednodes":{"value":1518,"limit":1000000},"ppgeneratednodes":{"value":0,"limit":1500000},"postexpandincludesize":{"value":30624,"limit":2097152},"templateargumentsize":{"value":1790,"limit":2097152},"expansiondepth":{"value":11,"limit":40},"expensivefunctioncount":{"value":3,"limit":500},"unstrip-depth":{"value":1,"limit":20},"unstrip-size":{"value":68736,"limit":5000000},"entityaccesscount":{"value":1,"limit":400},"timingprofile":["100.00%  342.488      1 -total"," 47.71%  163.386      1 Template:Reflist"," 37.45%  128.247     17 Template:Cite_web"," 16.60%   56.859      2 Template:Citation_needed"," 15.87%   54.368      1 Template:Infobox_programming_language"," 14.50%   49.653      2 Template:Fix"," 13.65%   46.748      1 Template:Infobox"," 10.56%   36.164      1 Template:Distinguish","  8.37%   28.679      4 Template:Category_handler","  4.97%   17.027      2 Template:Delink"]},"scribunto":{"limitreport-timeusage":{"value":"0.156","limit":"10.000"},"limitreport-memusage":{"value":4190581,"limit":52428800}},"cachereport":{"origin":"mw1346","timestamp":"20190413083301","ttl":2592000,"transientcontent":false}}});mw.config.set({"wgBackendResponseTime":102,"wgHostname":"mw1271"});});</script>
  595. </body>
  596. </html>
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×