<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>brainfuck &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/brainfuck/</link>
	<description>Feed of posts on WordPress.com tagged "brainfuck"</description>
	<pubDate>Fri, 04 Dec 2009 23:12:32 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[brainf**k : an esoteric programming language]]></title>
<link>http://casquid.wordpress.com/2009/11/25/brainfk-an-esoteric-programming-language/</link>
<pubDate>Wed, 25 Nov 2009 01:55:46 +0000</pubDate>
<dc:creator>falcon0x11</dc:creator>
<guid>http://casquid.wordpress.com/2009/11/25/brainfk-an-esoteric-programming-language/</guid>
<description><![CDATA[wiki reference http://en.wikipedia.org/wiki/Brainfuck compiler/interpreter: http://wuarchive.wustl.e]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>wiki reference <a href="http://en.wikipedia.org/wiki/Brainfuck">http://en.wikipedia.org/wiki/Brainfuck</a></p>
<p>compiler/interpreter: <a href="http://wuarchive.wustl.edu/pub/aminet/dev/lang/brainfuck-2.lha">http://wuarchive.wustl.edu/pub/aminet/dev/lang/brainfuck-2.lha</a></p>
<p>lhazipper:<a href="http://linux.softpedia.com/get/System/Archiving/LHa-31904.shtml"> http://linux.softpedia.com/get/System/Archiving/LHa-31904.shtml</a></p>
<p>PS: for x86 the source code should be modified.. 2nd link Includes interpreter and compiler for the Amiga. The interpreter can be compiled with <a title="http://gcc.gnu.org/" rel="nofollow" href="http://gcc.gnu.org/">gcc</a> by removing line 43, which says <em>chkabort();</em></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[La conoscenza in Brainfuck]]></title>
<link>http://taumazein.wordpress.com/2009/11/07/la-conoscenza-in-brainfuck/</link>
<pubDate>Sat, 07 Nov 2009 20:15:45 +0000</pubDate>
<dc:creator>taumazein</dc:creator>
<guid>http://taumazein.wordpress.com/2009/11/07/la-conoscenza-in-brainfuck/</guid>
<description><![CDATA[Quando venni a conoscenza dell&#8217;esistenza del linguaggio di programmazione &#8220;Brainfuck]]></description>
<content:encoded><![CDATA[Quando venni a conoscenza dell&#8217;esistenza del linguaggio di programmazione &#8220;Brainfuck]]></content:encoded>
</item>
<item>
<title><![CDATA[The Horrible Slow Murderer]]></title>
<link>http://tyresian.wordpress.com/2009/10/30/the-horrible-slow-murderer/</link>
<pubDate>Fri, 30 Oct 2009 01:05:48 +0000</pubDate>
<dc:creator>tyresian</dc:creator>
<guid>http://tyresian.wordpress.com/2009/10/30/the-horrible-slow-murderer/</guid>
<description><![CDATA[Irgendwie ist es beruhigend zu wissen, dass es Leute gibt, die a) genauso viel Scheisse im Kopf habe]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Irgendwie ist es beruhigend zu wissen, dass es Leute gibt, die a) genauso viel Scheisse im Kopf haben wie ich und b) etwas sinnvolles daraus machen.</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/9VDvgL58h_Y&#038;rel=0&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/9VDvgL58h_Y&#038;rel=0&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Kann nicht aufhören ... ]]></title>
<link>http://tyresian.wordpress.com/2009/10/25/kann-nicht-aufhoren/</link>
<pubDate>Sun, 25 Oct 2009 16:23:56 +0000</pubDate>
<dc:creator>tyresian</dc:creator>
<guid>http://tyresian.wordpress.com/2009/10/25/kann-nicht-aufhoren/</guid>
<description><![CDATA[http://www.getonmyhorse.com/ &#8230; nur zur Warnung &#8230; es macht süchtig &#8230; sehr süchtig! ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a title="GET ON MY HORSE" href="http://www.getonmyhorse.com/" target="_blank">http://www.getonmyhorse.com/</a></p>
<p>&#8230; nur zur Warnung &#8230; es macht süchtig &#8230; sehr süchtig!</p>
<p>Lyrics:    <!--more--></p>
<p>Look at my horse,</p>
<p>My horse is amazing</p>
<p>Give it a lick</p>
<p>Hmm, It tastes just like raisins</p>
<p>Have a stroke of it’s mane</p>
<p>It turnes into a plane</p>
<p>And then it turns back again</p>
<p>When you tug on it’s winky</p>
<p>Ohh that’s dirty</p>
<p>Do you think think so?</p>
<p>Well I’d better not show you where the lemonade is made</p>
<p>Sweet lemonade</p>
<p>Mmm sweet lemonade</p>
<p>Sweet lemonade</p>
<p>Yeah sweet lemonade</p>
<p>Get on my horse</p>
<p>I’ll take you round the universe</p>
<p>And all the other places too</p>
<p>I think you’ll find that the universe pretty much covers everything</p>
<p>Shut up woman get on my horse</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[What is Brainfuck?]]></title>
<link>http://boddhayan.wordpress.com/2009/10/24/what-is-brainfuck/</link>
<pubDate>Sat, 24 Oct 2009 14:04:54 +0000</pubDate>
<dc:creator>boddhayan</dc:creator>
<guid>http://boddhayan.wordpress.com/2009/10/24/what-is-brainfuck/</guid>
<description><![CDATA[Brainfuck is probably the most famous of the esoteric (i.e. Confined to and understandable by only a]]></description>
<content:encoded><![CDATA[Brainfuck is probably the most famous of the esoteric (i.e. Confined to and understandable by only a]]></content:encoded>
</item>
<item>
<title><![CDATA[Brainfuck Python Interpreter]]></title>
<link>http://magicpc.wordpress.com/2009/10/20/brainfuck-python-interpreter/</link>
<pubDate>Mon, 19 Oct 2009 22:31:17 +0000</pubDate>
<dc:creator>Abd Allah Diab</dc:creator>
<guid>http://magicpc.wordpress.com/2009/10/20/brainfuck-python-interpreter/</guid>
<description><![CDATA[What is brainfuck? Brainfuck is a programming language This is the definition from Wikipedia: The br]]></description>
<content:encoded><![CDATA[What is brainfuck? Brainfuck is a programming language This is the definition from Wikipedia: The br]]></content:encoded>
</item>
<item>
<title><![CDATA[Однажды в лесу...]]></title>
<link>http://alkotrash.wordpress.com/2009/10/13/3/</link>
<pubDate>Tue, 13 Oct 2009 19:20:01 +0000</pubDate>
<dc:creator>alkotrash</dc:creator>
<guid>http://alkotrash.wordpress.com/2009/10/13/3/</guid>
<description><![CDATA[В лесу уже темнело, Джонатан начинал нервничать. Ещё бы он боялся темноты с детства из-за отца педоф]]></description>
<content:encoded><![CDATA[В лесу уже темнело, Джонатан начинал нервничать. Ещё бы он боялся темноты с детства из-за отца педоф]]></content:encoded>
</item>
<item>
<title><![CDATA[Brainfuck]]></title>
<link>http://dnrip.wordpress.com/2009/10/03/brainfuck/</link>
<pubDate>Sat, 03 Oct 2009 11:57:28 +0000</pubDate>
<dc:creator>druedi</dc:creator>
<guid>http://dnrip.wordpress.com/2009/10/03/brainfuck/</guid>
<description><![CDATA[Beim gestringen abendlichen Gespräch mit einem sehr guten Freund, kamen wir irgendwie (mal wieder) a]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;">Beim gestringen abendlichen Gespräch mit einem sehr guten Freund, kamen wir irgendwie (mal wieder) auf Programmiersprachen. Irgendwann kamen wir dabei auf das Thema Brainfuck &#8211; Eine eher ungewöhnliche Sprache, die mit insgesamt 8 Befehlszeichen auskommt.</p>
<p style="text-align:justify;">Um die Sprache kurz anzudeuten, nehme ich mal das kleine Tutorialbeispiel, welches es im später erwähnten Tutorial noch zu sehen und erklärt gibt:</p>
<blockquote>
<p style="text-align:justify;"><span style="color:#ffcc00;">+++++[&#62;+++++++++++++&#60;-]+++++++++[&#62;&#62;++++++++++&#60;&#60;-]&#62;+.&#62;-.&#60;+++.</span></p>
</blockquote>
<p style="text-align:justify;">Diese Ansammlung von Zeichen ergibt in mit Hilfe eines Brainfuck-Compilers zum Beispiel das Wörtchen BYE.</p>
<p style="text-align:justify;">All zu sehr ins Detail gehen möchte ich dazu aber nicht, denn das folgende Tutorial erlkärt die Funktionsweise von Brainfuck, meiner Meinung nach, sehr gut.</p>
<p style="text-align:justify;">http://www.youtube.com/watch?v=OnQobTyqEd0</p>
<p style="text-align:justify;">Ich werde mich die Tage mal ein wenig mit dieser Sprache auseinandersetzen um zu gucken was man damit alles so anstellen kann.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Brainfuck .... ]]></title>
<link>http://kar2905.wordpress.com/2009/09/27/brainfuck/</link>
<pubDate>Sat, 26 Sep 2009 20:10:49 +0000</pubDate>
<dc:creator>Kartik Mandaville</dc:creator>
<guid>http://kar2905.wordpress.com/2009/09/27/brainfuck/</guid>
<description><![CDATA[What&#8217;s the first thing that comes into your mind reading this ?? ( I am leaving the list empty]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>What&#8217;s the first thing that comes into your mind reading this ?? ( I am leaving the list empty ) ..<br />
Well, let me break the suspense .. <br />
Brainfuck is a programming Language ..</p>
<p><strong>From wiki ,</strong></p>
<p>The <strong>brainfuck</strong> programming language is an esoteric programming language noted for its extreme minimalism. It is a Turing tarpit, designed to challenge and amuse programmers, and is not suitable for practical use. Its name has been variously bowdlerized. The name of the language is generally not capitalized, although it is a proper noun.</p>
<p> <strong>How I came across BRAINFUCK</strong>  :</p>
<p>I came to know about this language through a senior ( <a href="http://akshaytech.wordpress.com/">Akshay Kothari </a>) &#8230; Infact , our LUG Manipal T-Shirts have a brainfuck code on the backside &#8230; Hence , I was determined to learn Brainfuck ..</p>
<p>I started with some basic stuff like Hello World.  Then , I started to write a code to display  &#8221;BRAINFUCK IS COOL &#8220;</p>
<p>Here&#8217;s the code :</p>
<p>
<pre class="brush: css;">&#60;/p&#62;
&#60;p&#62;+++++++++[&#38;gt;+++++++&#38;gt;+++++++++&#38;gt;+++++++&#38;gt;++++++++&#38;gt;+++++++++&#38;gt;++++++++&#38;gt;+++++++++&#38;gt;+++++++&#38;gt;++++++++&#38;gt;&#60;br /&#62;
++++&#38;gt;++++++++&#38;gt;+++++++++&#38;gt;++++&#38;gt;+++++++&#38;gt;+++++++++&#38;gt;++++++++&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;-]&#38;gt;+++.&#38;gt;+.&#38;gt;++.&#38;gt;+.&#38;gt;---.&#38;gt;&#60;br /&#62;
--.&#38;gt;++++.&#38;gt;++++.&#38;gt;+++.&#38;gt;----.&#38;gt;+.&#38;gt;++.&#38;gt;----.&#38;gt;++++.&#38;gt;--..&#38;gt;++++.&#60;/p&#62;
&#60;p&#62;</pre>
</p>
<p> </p>
<p>Next on the list is to probably implement some of the basic programs like Fibonacci , Loops , etc</p>
<p>PS: With brainfuck , I have further increased my knowledge of different languages ..</p>
<p>For more info , <a href="http://en.wikipedia.org/wiki/Brainfuck" target="_blank">WIKI</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[IDE[?]]]></title>
<link>http://eunaoseinada.wordpress.com/2009/09/17/ide/</link>
<pubDate>Thu, 17 Sep 2009 18:39:08 +0000</pubDate>
<dc:creator>eunaoseinada</dc:creator>
<guid>http://eunaoseinada.wordpress.com/2009/09/17/ide/</guid>
<description><![CDATA[Escrever códigos-fonte sempre foi uma coisa simples. Tirando brainfuck escrever códigos é uma tarefa]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Escrever códigos-fonte sempre foi uma coisa simples. Tirando <a href="http://pt.wikipedia.org/wiki/Brainfuck" target="_blank">brainfuck</a> escrever códigos é uma tarefa realmente simles, acredite. Apesar dos leigos não conseguirem entender como conseguimos decorar tantas &#8220;palavras&#8221; conseguimos, com muita facilidade &#8211; talvez &#8211; entender o significado do que escrevemos e conseguimos fazer com que o computador entenda o que queremos, às vezes. Claro que qualquer código-fonte precisa ser escrito, e por isso, existem diversos programas no mercado que nos permitem escrever este código. Muita gente usa o VIM, NANO, Notepad, Notepad++, Eclipse, Netbeans, Aptana, etc. No entanto com a evolução e necessidade de acelerarmos o desenvolvimento criamos as <a href="http://pt.wikipedia.org/wiki/Ambiente_de_Desenvolvimento_Integrado" target="_blank">IDE</a>s. Qual a melhor? Não existe! Digo isso por experiência própria, pois já usei o Notepad, Gedit (quando me achava e gosta de impressionar as gatinhas), VIM, NANO (idem), Eclipse e derivados, NetBeans e Cia. LTDA. Hoje uso o Kate. A melhor IDE, obviamente é a que você se acostumar melhor. Claro que algumas IDEs já são &#8220;funcking-killer-softwares&#8221; uma vez que foram projetadas para atender determinadas demandas, como NetBeans para o Java e o PHPEclipse &#8211; Galileo para o PHP. no caso, essas IDEs vem para somar no desenvolvimento de aplicativos, possuindo plugins e estrutura para maior conforto do programador. Muita gente vai dizer que a melhor é x, y ou z, mas como disse isso é muito relativo. A melhor coisa a fazer é testar todas as IDEs possíveis e usar a que achar melhor. Como atualmente trabalho somente com a tríade PHP + Javascript(jQuery) + MySQL (mentira só sei isso) listarei algumas IDEs para testarem. Não vou comentá-las porque não to afim.</p>
<p>Google.com:IDE+DESENVOLVIMENTO+WEB</p>
<p><a href="http://www.eclipse.org/galileo/" target="_blank">Eclipse Galileo</a>, <a href="http://www.netbeans.org/features/php/" target="_blank">NetBeans PHP</a>, <a href="http://aptana.com/" target="_blank">Aptana</a></p>
<p>Javascript: Pode usar todas acima, mas dizem que a Aptana é a melhor para tal</p>
<p><a href="http://dev.mysql.com/downloads/gui-tools/5.0.html" target="_blank">MySQL</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[SlackYou: Linguaggio di programmazione esoterico]]></title>
<link>http://porkynator.wordpress.com/2009/08/28/slackyou-linguaggio-di-programmazione-esoterico/</link>
<pubDate>Fri, 28 Aug 2009 18:07:36 +0000</pubDate>
<dc:creator>porkynator</dc:creator>
<guid>http://porkynator.wordpress.com/2009/08/28/slackyou-linguaggio-di-programmazione-esoterico/</guid>
<description><![CDATA[Dopo aver completato il compilatore per BrainFuck, mi è venuta l&#8217;idea di creare un linguaggio ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Dopo aver completato il compilatore per BrainFuck, mi è venuta l&#8217;idea di creare un linguaggio di programmazione esoterico. Il nome è ispirato alla filosofia della Church of Subgenius (come il nome della distribuzione linux). Inventare un linguaggio di programmazione è molto più facile di come può sembrare: basta inventarsi la sintassi dei comandi (in questo caso ispirati a BrainFuck) e fare un compilatore.</p>
<p>Il compilatore potete scaricarlo da qui: <a href="http://porkynator.altervista.org/syi-1.1.zip">http://porkynator.altervista.org/syi-1.1.zip</a></p>
<p>Mentre la pagina che contiene la spiegazione dettagliata delle istruzioni è questa: <a href="http://porkynator.altervista.org/SlackYou.html">http://porkynator.altervista.org/SlackYou.html</a><br />
Buon divertimento!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Compilatore BrainFuck in Java]]></title>
<link>http://porkynator.wordpress.com/2009/08/27/compilatore-brainfuck-in-java/</link>
<pubDate>Thu, 27 Aug 2009 16:09:26 +0000</pubDate>
<dc:creator>porkynator</dc:creator>
<guid>http://porkynator.wordpress.com/2009/08/27/compilatore-brainfuck-in-java/</guid>
<description><![CDATA[Negli utlimi giorni mi sono scervellato (e non poco) per scrivere un compilatore per BrainFuck in ja]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Negli utlimi giorni mi sono scervellato (e non poco) per scrivere un compilatore per <a href="http://it.wikipedia.org/wiki/Brainfuck">BrainFuck</a> in java.<br />
Per chi non sapesse di cosa sto parlando, BrainFuck è un <a href="http://it.wikipedia.org/wiki/Linguaggio_di_programmazione_esoterico">linguaggio di programmazione esoterico</a> inventato nel 1993 da un tale Urban Muller. Lo scopo del linguaggio è avere un compilatore il più piccolo possibile (infatti il suo compilatore originale pesava solo 240 byte (quello che ho fatto io un po&#8217; di più <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). Per saperne di più visitate la sua pagina in wikipedia.<br />
Il mio compilatore (sorgenti inclusi) lo potete scaricare da qui: http://porkynator.altervista.org/pbfi-1.1.zip. Consente, oltre a compilare il codice BF, anche di salvare o aprire progetti, e contiene 3 programmi d&#8217;esempio (Hello World, Quine e 99 bottles of beer).<br />
Solo un piccolo appunto sul codice: non riuscivo a far funzionare le parentesi, così ho escogitato questo piccolo trucco: <!--more--><br />
Innanzitutto creo un array di char che contiene tutti i caratteri .,+-&#62;&#60;[] che trova nella casella di testo e aggiunge un carattere (da &#39;a&#39; in avanti)  dopo ogni parentesi aperta e prima di ogni chiusa, in modo da segnare le corrispondenti. quindi se inserite il codice:</p>
<p><code>codice casuale che non ho la minima idea di cosa faccia:<br />
,+++++++[ dg&#60; +++++++. [ --  [ +.  ]&#62;&#62;]</code><br />
il mio compilatore se lo traduce in :</p>
<p><code>,+++++++[a&#60;+++++++.[b --<b>[c+.b]&#62;&#62;a]</code><br />
per riuscire a trovare le parentesi corrispondenti.<br />
Ad esempio quando arriva a una parentesi aperta, se il byte al puntatore è 0, guarda il byte successivo e lo memorizza come &#8220;chiave&#8221;, poi va avanti fino all&#8217;istruzione dopo la parentesi quadra chiusa che segue il successivo simbolo chiave.</p>
<p>Si lo so è un casino, mi sono scervellato 2 giorni (o erano 3? ho anche perso il conto&#8230;) per arrivarci.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Brainfuck - Uma linguagem para lá de esquisita]]></title>
<link>http://deutrixcorp.wordpress.com/2009/08/20/brainfuck-uma-linguagem-para-la-de-esquisita/</link>
<pubDate>Fri, 21 Aug 2009 00:03:02 +0000</pubDate>
<dc:creator>Antônio Euclides</dc:creator>
<guid>http://deutrixcorp.wordpress.com/2009/08/20/brainfuck-uma-linguagem-para-la-de-esquisita/</guid>
<description><![CDATA[Brainfuck é uma linguagem de programação esotérica (O que você esperava que fosse?) criada em 1993 p]]></description>
<content:encoded><![CDATA[Brainfuck é uma linguagem de programação esotérica (O que você esperava que fosse?) criada em 1993 p]]></content:encoded>
</item>
<item>
<title><![CDATA[Connected]]></title>
<link>http://control9.wordpress.com/2009/08/02/connected/</link>
<pubDate>Sat, 01 Aug 2009 23:27:25 +0000</pubDate>
<dc:creator>control9</dc:creator>
<guid>http://control9.wordpress.com/2009/08/02/connected/</guid>
<description><![CDATA[Доехали норм. В поезде объяснял новоиспеченным девятиклассникам Brainf*ck Некоторых удалось серьёзно]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Доехали норм. В поезде объяснял новоиспеченным девятиклассникам Brainf*ck <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Некоторых удалось серьёзно заинтересовать о_О&#8230; В остальном всё норм, комната на 3 человека&#8230; Скоро подъём&#8230; фацк =(</p>
<p>*зы &#8211; время этой публикации по москве, последующих до прибытия &#8211; местное.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Brainfuck in Scala]]></title>
<link>http://dgronau.wordpress.com/2009/07/30/brainfuck-in-scala/</link>
<pubDate>Thu, 30 Jul 2009 21:17:16 +0000</pubDate>
<dc:creator>dgronau</dc:creator>
<guid>http://dgronau.wordpress.com/2009/07/30/brainfuck-in-scala/</guid>
<description><![CDATA[Heute habe ich irgendwie keine Lust auf etwas ernsthaftes, also habe ich meinen kleinen Brainfuck-In]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Heute habe ich irgendwie keine Lust auf etwas ernsthaftes, also habe ich meinen kleinen Brainfuck-Interpreter ausgebuddelt. <a href="http://de.wikipedia.org/wiki/Brainfuck">Brainfuck</a> ist nichts schweinisches, sondern eine minimalistische turing-komplette Programmiersprache. Allerdings kostet es ganz schon Gehirnschmalz, darin etwas Vernünftiges zu progammieren &#8211; ich denke, ein Interpreter dafür ist leichter zu schreiben.</p>
<p>Meine Implementierung sollte möglichst flexibel sein, also z.B. sollte man einfach von einem &#8220;Band&#8221; mit Bytes auf eines mit Ints umsteigen können. Das Band sollte (im Gegensatz zur Original-Definition) in beide Richtungen unendlich lang sein. Und natürlich alles wieder ohne veränderliche Datenstrukturen. Klingt schwierig, ist es aber nicht. Zuerst die Operationen, die man auf dem Band ausführen können muss:</p>
<pre class="brush: java;">
trait Func[T] {
    val zero:T
    def inc(t:T):T
    def dec(t:T):T
    def in: T
    def out(t: T):Unit
}

trait ByteFunc extends Func[Byte] {
    override val zero:Byte = 0
    override def inc(t:Byte) = ((t + 1) &amp; 0xFF).toByte
    override def dec(t:Byte) = ((t - 1) &amp; 0xFF).toByte
    override def in:Byte = readByte
    override def out(t: Byte) { print(t.toChar) }
}
</pre>
<p>Alles sehr elementar, wie man sieht. Nun das Band selber, das schwieriger aussieht, als es eigentlich ist. Die Grundidee ist, das Band mit dem aktuellen Wert und zwei Listen zu repräsentieren. Angenomme, das Band sieht so aus:<br />
1 2 3 4 [5] 6 7 8<br />
Dann ist meine aktuelle Zelle 5, alles davor wird &#8220;rückwärts&#8221; durch List(4,3,2,1) repräsentiert, alles danach durch List(6,7,8). Um einen Schritt zurückzugehen, füge ich meinen Wert 5 als Kopf der zweiten Liste an und mache den Kopf der ersten Liste zu meinem aktuellen Wert:<br />
1 2 3 [4] 5 6 7 8. Komme ich ans Ende einer der Listen, liefere ich einfach Nullen.</p>
<pre class="brush: java;">
class Tape[T](val cell:T, private val left:List[T], private val right:List[T], val func:Func[T]) {

    def inc = new Tape(func.inc(cell),left, right, func )
    def dec = new Tape(func.dec(cell),left, right, func)
    def goLeft = left match {
        case Nil =&gt; new Tape(func.zero,Nil, cell :: right, func)
        case head :: tail =&gt; new Tape(head, tail, cell :: right, func )
    }
    def goRight = right match {
        case Nil =&gt; new Tape(func.zero, cell:: left, Nil, func)
        case head :: tail =&gt; new Tape(head, cell :: left, tail, func)
    }
    def output = {
         func.out(cell)
         this
    }
    def input() = new Tape(func.in, left, right, func)
    def isZero = cell == func.zero
}

object Tape {
    def apply[T](func:Func[T]) = new Tape(func.zero, Nil, Nil, func)
}
</pre>
<p>Voila, ein unendliches Band! Natürlich wird bei jeder Operation ein neues Band zurückgeliefert, aber das ist nicht so schlimm, wie es klingt: Da alle Datenstrukturen unveränderlich sind, können auch alle ihre Bestandteile wiederverwendet werden.</p>
<pre class="brush: java;">
object Brainfuck {
   def execute(prog: String) {
       println(&quot;---running---&quot;)
       execute(prog.replaceAll(&quot;[^\\+\\-\\[\\]\\.\\,\\&gt;\\&lt;]&quot;, &quot;&quot;), 0, Tape(new ByteFunc{}))
   }

    def execute(prog: String, pos:Int, tape:Tape[Byte]) {

        def closedBracePos(bPos:Int, count:Int):Int =
           if (count &lt; 0 &amp;#124;&amp;#124; bPos == prog.length)
              error (&quot;Unbalanced braces&quot;)
           else prog.charAt(bPos) match {
               case '[' =&gt; closedBracePos(bPos + 1, count + 1)
               case ']' =&gt;  if (count == 0) bPos
                            else closedBracePos(bPos + 1, count - 1)
               case _ =&gt;  closedBracePos(bPos + 1, count)
           }

        def openBracePos(bPos:Int, count:Int):Int =
           if (count &lt; 0 &amp;#124;&amp;#124; bPos &lt; 0)
              error (&quot;Unbalanced braces&quot;)
           else prog.charAt(bPos) match {
               case ']' =&gt; openBracePos(bPos - 1, count + 1)
               case '[' =&gt;  if (count == 0) bPos
                            else openBracePos(bPos - 1, count - 1)
               case _ =&gt;  openBracePos(bPos - 1, count)
           }

        if(pos &lt; prog.length) prog.charAt(pos) match {
          case '+' =&gt; execute(prog, pos + 1, tape.inc)
          case '-' =&gt; execute(prog, pos + 1, tape.dec)
          case '&gt;' =&gt; execute(prog, pos + 1, tape.goRight)
          case '&lt;' =&gt; execute(prog, pos + 1, tape.goLeft)
          case '.' =&gt; execute(prog, pos + 1, tape.output)
          case ',' =&gt; execute(prog, pos + 1, tape.input)
          case '[' =&gt; if (tape.isZero) execute(prog, closedBracePos(pos + 1, 0) + 1, tape)
                      else execute(prog, pos + 1, tape)
          case ']' =&gt; if (! tape.isZero) execute(prog, openBracePos(pos - 1, 0), tape)
                      else execute(prog, pos + 1, tape)
        } else {
          println(&quot;\n---done---&quot;)
        }
    }

   def main(args:Array[String]) {
       if (args.length == 1) execute(args(0))
       else println(&quot;First parameter must be a Brainfuck program&quot;)
   }
}
</pre>
<p>Der Interpreter ist ziemlich einfach: Das Brainfuck-Programm wird als String geladen. Zuerst werden alle Kommentare entfernt &#8211; Brainfuck betrachtet alle Zeichen, denen kein Befehl zugeordnet ist, als Kommentar. Danach wird mit einem neuen, leeren Band gestartet. Die schwierigste Aufgabe ist, die richtige öffnende Klammer zu einer schließenden Klammer zu finden (und umgekehrt), denn natürlich dürfen diese geschachtelt werden. Eckige Klammern dienen übrigens als Schleifenkonstrukt von Brainfuck.</p>
<p>Bleibt bloß noch, das Programm einmal auszuprobieren. Hier ein paar Anregungen:</p>
<pre class="brush: java;">
//Hello World
&gt;+++++++++[&lt;++++++++&gt;-]&lt;.&gt;+++++++[&lt;++++&gt;-]&lt;+.+++++++..+++.[-]&gt;++++++++
[&lt;++++&gt;-]&lt;.#&gt;+++++++++++[&lt;+++++&gt;-]&lt;.&gt;++++++++[&lt;+++&gt;-]&lt;.+++.------.--------.
[-]&gt;++++++++[&lt;++++&gt;-]&lt;+.[-]++++++++++.&quot;&quot;&quot;)

//Die Zahlen von 9 bis 0
++++++++++++++++++++++++++++++++[&gt;+&gt;+&lt;&lt;-]
&gt;&gt;+++++++++++++++++++++++++&lt;&lt;++++++++++[&gt;&gt;.-&lt;.&lt;-]

//ein Brainfuck-Quine
//siehe http://de.wikipedia.org/wiki/Quine_(Computerprogramm)
-&gt;+&gt;+++&gt;&gt;+&gt;++&gt;+&gt;+++&gt;&gt;+&gt;++&gt;&gt;&gt;+&gt;+&gt;+&gt;++&gt;+&gt;&gt;&gt;&gt;+++&gt;+&gt;&gt;++&gt;+&gt;+++
&gt;&gt;++&gt;++&gt;&gt;+&gt;&gt;+&gt;++&gt;++&gt;+&gt;&gt;&gt;&gt;+++&gt;+&gt;&gt;&gt;&gt;++&gt;++&gt;&gt;&gt;&gt;+&gt;&gt;++&gt;+&gt;+++&gt;&gt;&gt;
++&gt;&gt;++++++&gt;&gt;+&gt;&gt;++&gt;+&gt;&gt;&gt;&gt;+++&gt;&gt;+++++&gt;&gt;+&gt;+++&gt;&gt;&gt;++&gt;&gt;++&gt;&gt;+&gt;&gt;++&gt;
+&gt;+++&gt;&gt;&gt;++&gt;&gt;+++++++++++++&gt;&gt;+&gt;&gt;++&gt;+&gt;+++&gt;+&gt;+++&gt;&gt;&gt;++&gt;&gt;++++&gt;&gt;
+&gt;&gt;++&gt;+&gt;&gt;&gt;&gt;+++&gt;&gt;+++++&gt;&gt;&gt;&gt;++&gt;&gt;&gt;&gt;+&gt;+&gt;++&gt;&gt;+++&gt;+&gt;&gt;&gt;&gt;+++&gt;+&gt;&gt;&gt;&gt;
+++&gt;+&gt;&gt;&gt;&gt;+++&gt;&gt;++&gt;++&gt;+&gt;+++&gt;+&gt;++&gt;++&gt;&gt;&gt;&gt;&gt;&gt;++&gt;+&gt;+++&gt;&gt;&gt;&gt;&gt;+++&gt;&gt;
&gt;++&gt;+&gt;+++&gt;+&gt;+&gt;++&gt;&gt;&gt;&gt;&gt;&gt;++&gt;&gt;&gt;+&gt;&gt;&gt;++&gt;+&gt;&gt;&gt;&gt;+++&gt;+&gt;&gt;&gt;+&gt;&gt;++&gt;+&gt;++
++++++++++++++++&gt;&gt;&gt;&gt;+&gt;+&gt;&gt;&gt;+&gt;&gt;++&gt;+&gt;+++&gt;&gt;&gt;++&gt;&gt;++++++++&gt;&gt;+&gt;&gt;
++&gt;+&gt;&gt;&gt;&gt;+++&gt;&gt;++++++&gt;&gt;&gt;+&gt;++&gt;&gt;+++&gt;+&gt;+&gt;++&gt;+&gt;+++&gt;&gt;&gt;&gt;&gt;+++&gt;&gt;&gt;+&gt;
+&gt;&gt;++&gt;+&gt;+++&gt;&gt;&gt;++&gt;&gt;++++++++&gt;&gt;+&gt;&gt;++&gt;+&gt;&gt;&gt;&gt;+++&gt;&gt;++++&gt;&gt;+&gt;+++&gt;&gt;
&gt;&gt;&gt;&gt;++&gt;+&gt;+++&gt;&gt;+&gt;++&gt;&gt;&gt;&gt;+&gt;+&gt;++&gt;+&gt;&gt;&gt;&gt;+++&gt;&gt;+++&gt;&gt;&gt;+[[-&gt;&gt;+&lt;&lt;]&lt;+]+
++++[-&gt;+++++++++&lt;]&gt;.[+]&gt;&gt;[&lt;&lt;+++++++[-&gt;+++++++++&lt;]&gt;-.-----------
--------&gt;-[-&lt;.&lt;+&gt;&gt;]&lt;[+]&lt;+&gt;&gt;&gt;]&lt;&lt;&lt;[-[-[-[&gt;&gt;+&lt;++++++[-&gt;+++++&lt;]]&gt;++++
++++++++++&lt;]&gt;+++&lt;]++++++[-&gt;+++++++&lt;]&gt;+&lt;&lt;&lt;-[-&gt;&gt;&gt;++&lt;&lt;&lt;]&gt;[-&gt;&gt;.&lt;&lt;]&lt;&lt;]
</pre>
<p>Na dann, viel Spaß mit Brainfuck!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Atyaisten!]]></title>
<link>http://gerzsonka.wordpress.com/2009/07/10/atyaisten/</link>
<pubDate>Fri, 10 Jul 2009 20:19:19 +0000</pubDate>
<dc:creator>Gerzson</dc:creator>
<guid>http://gerzsonka.wordpress.com/2009/07/10/atyaisten/</guid>
<description><![CDATA[Már 26 H1N1 fertőzött van! Azt képzeld el, mi lesz, ha meghal az első! Hetekig mást se hallunk!]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Már 26 H1N1 fertőzött van!</p>
<p>Azt képzeld el, mi lesz, ha meghal az első! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  Hetekig mást se hallunk!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Тяжкий бред")]]></title>
<link>http://control9.wordpress.com/2009/06/21/%d1%82%d1%8f%d0%b6%d0%ba%d0%b8%d0%b9-%d0%b1%d1%80%d0%b5%d0%b4/</link>
<pubDate>Sat, 20 Jun 2009 22:12:19 +0000</pubDate>
<dc:creator>control9</dc:creator>
<guid>http://control9.wordpress.com/2009/06/21/%d1%82%d1%8f%d0%b6%d0%ba%d0%b8%d0%b9-%d0%b1%d1%80%d0%b5%d0%b4/</guid>
<description><![CDATA[Первому кто поймёт что ЭТО делает от меня какой-нибудь приз&#8221;) &gt;&gt;&gt;&gt;&gt;,&gt;,&gt;]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Первому кто поймёт что ЭТО делает от меня какой-нибудь приз&#8221;)</p>
<p><strong>&#62;&#62;&#62;&#62;&#62;,&#62;,&#62;&#62;,-[[-&#62;+&#60;]&#62;-]+&#60;&#60;&#60;[&#62;]&#60;[&#62;]<br />
&#62;[&#60;&#60;[-&#60;+&#62;]&#62;&#62;&#62;-]<br />
&#62;[&#60;&#60;&#60;[-&#60;-&#62;]&#60;[-&#60;+&#62;]&#62;&#62;&#62;&#62;-]<br />
&#62;[&#60;&#60;&#60;&#60;[-&#60;[-&#60;+&#62;&#62;&#62;+&#60;&#60;]&#62;&#62;[-&#60;&#60;+&#62;&#62;]&#60;]&#62;&#62;&#62;&#62;-]<br />
&#62;[&#60;&#60;&#60;&#60;&#60;[-&#60;&#60;+&#62;&#62;&#62;+&#60;]&#60;&#60;[-&#62;&#62;+&#60;&#60;]&#62;[&#62;[-&#60;[&#62;&#62;&#62;&#62;&#62;]&#60;&#60;&#60;&#60;&#60;-&#62;]&#62;[-&#60;+&#60;&#60;&#60;+&#62;&#62;&#62;&#62;]&#60;&#60;&#60;&#60;[-&#62;&#62;&#62;&#62;+&#60;&#60;&#60;&#60;]&#62;+&#62;&#62;&#62;&#62;&#62;[&#62;]&#60;[&#62;]&#60;&#60;&#60;]&#62;&#62;&#62;&#62;&#62;&#62;-]&#60;&#60;&#60;&#60;&#60;&#60;&#60;.</strong></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Hello World]]></title>
<link>http://wirtschaftsinformatiker.wordpress.com/2009/06/15/hello-world/</link>
<pubDate>Mon, 15 Jun 2009 20:06:22 +0000</pubDate>
<dc:creator>fuki13</dc:creator>
<guid>http://wirtschaftsinformatiker.wordpress.com/2009/06/15/hello-world/</guid>
<description><![CDATA[Dies ist mein erster Artikel in diesem Blog. Ich freue mich in Zukunft über Themen der Wirtschaftsin]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Dies ist mein erster Artikel in diesem Blog. Ich freue mich in Zukunft über Themen der Wirtschaftsinformatik berichten zu können und hoffe, dass der eine oder andere interessierte Leser unter euch ist.</p>
<div>Die Verwendung von „Hello, world!“, geht übrigens auf ein internes Programmierhandbuch der Bell Laboratories über die Programmiersprache C zurück, das Brian Kernighan 1974 verfasste. Bekanntheit erlangte der Text jedoch erst durch die Veröffentlichung in dem Buch <em><span lang="en">The C Programming Language</span></em> von Brian Kernighan und Dennis Ritchie [<a title="Hello_World" href="http://de.wikipedia.org/wiki/Hello_World">Wikipedia</a>]. Wikipedia enthält übrigens auch eine <a title="Liste_von_Hallo-Welt-Programmen" href="http://de.wikipedia.org/wiki/Liste_von_Hallo-Welt-Programmen/Programmiersprachen">Liste von Hello World Programmen</a> in den unterschiedlichsten Programmiersprachen, z.B. in der esoterischen und Turing-vollständigen Programmiersprache <a title="Brainfuck" href="http://de.wikipedia.org/wiki/Brainfuck">Brainfuck</a> vom Schweizer Urban Müller:</div>
<div><code>++++++++++[&#62;+++++++&#62;++++++++++&#62;+++&#62;+&#60;&#60;&#60;&#60;-]&#62;++.&#62;+.+++++++..+++.&#62;++.&#60;&#60;+++++++++++++++.&#62;.+++.------.--------.&#62;+.&#62;.</code></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[פוסט פתיחה.]]></title>
<link>http://nonacha.wordpress.com/2009/06/14/%d7%a4%d7%95%d7%a1%d7%98-%d7%a4%d7%aa%d7%99%d7%97%d7%94/</link>
<pubDate>Sun, 14 Jun 2009 10:41:04 +0000</pubDate>
<dc:creator>nonacha</dc:creator>
<guid>http://nonacha.wordpress.com/2009/06/14/%d7%a4%d7%95%d7%a1%d7%98-%d7%a4%d7%aa%d7%99%d7%97%d7%94/</guid>
<description><![CDATA[מפאת קוצר בזמן (אני ארמוז קלות שהבגרות בהיסטוריה אשמה בכך), אני אדחה את הביקורת הראשונה שלי למחר. הפ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>מפאת קוצר בזמן (אני ארמוז קלות שהבגרות בהיסטוריה אשמה בכך), אני אדחה את הביקורת הראשונה שלי למחר. הפוסט הזה יהווה מן.. פוסט פתיחה שכזה לבלוג, בתקווה שלי (ושלכם) שלא יהיו פוסטים מיותרים כל-כך בעתיד.</p>
<p>אז&#8230; מה לי ולוורדפרס? זהו, שכלום. בלוגלי כל הזמן קורס, אז בחיפוש אחר תחלופה הולמת שפחתכם הנאמנה הגיעה לוורדפרס (מה שמתברר כלא-כל-כך חכם בדיעבד, המערכת הזו מאמללת אותי).</p>
<p><strong>אז&#8230; בקצרה עליי ועל הבלוג;</strong> </p>
<p>שמי נועה (לא חמודים, לא קוראים לי נונה. ואף אחד לא התאכזר אליי בלידה עם השם הזה) ואני מוכרת יותר כנונה-צ&#8217;אן במספר קהילות (Nona Chan). אני אוטאקואית מרכזניקית בת 16, חובבת גנדמים, מכה והמון דרמה-טרגדיה-פסיכולוגי.  למרות חיבתי המאוד מוקצנת למכה, אני מבטיחה לא לתת לזה להשתלט על הבלוג (אם כי תצפו לביקורת מכה בימים הקרובים).</p>
<p>למרות חיבתי העזה לבדיחות &#8220;הומואים קסומים&#8221; (ע&#8221;ש האנימה Antique Bakery), איני פנגירלז (לצערכם או למזלכם), לכן אל תצפו לראות כאן ביקורות יאוי למינהן, וביקורות שונאן איי כמעט ולא יופיעו כאן. כן כן פנגירלז, הומואים לא עושים לי את זה, על כן סביר להניח שאם חיפשתן ביקורת לפרק האחרון של ג&#8217;ונג&#8217;ו רומנטיקה &#8211; לא תמצאו את זה כאן.</p>
<p>כל החפץ בהחלפת קישורים עימי מוזמן לעשות כך, אשמח להוסיף לינקים לבלוגים נוספים בתחום האנימה. כמו כן, ברצוני להודות לחן/צ&#8217;יב (המוכרת לרובכם מבלוג האנימה Tsukiakari) על הלוגו לבלוג, ועל חפירת הבוקר-טוב שלי. תודה חןחן 3&#62;</p>
<p style="text-align:left;"><strong>בברכת קריאה מהנה לכל הקוראים,</strong></p>
<p style="text-align:left;"><strong>נונה.</strong></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[BF]]></title>
<link>http://soultrav.wordpress.com/2009/06/12/bf/</link>
<pubDate>Fri, 12 Jun 2009 00:00:29 +0000</pubDate>
<dc:creator>Soultrav</dc:creator>
<guid>http://soultrav.wordpress.com/2009/06/12/bf/</guid>
<description><![CDATA[Of course, I only post in the exam session; this is a must-have for my repository, a printscreen wit]]></description>
<content:encoded><![CDATA[Of course, I only post in the exam session; this is a must-have for my repository, a printscreen wit]]></content:encoded>
</item>
<item>
<title><![CDATA[It works!:)]]></title>
<link>http://control9.wordpress.com/2009/05/28/it-works/</link>
<pubDate>Wed, 27 May 2009 21:24:53 +0000</pubDate>
<dc:creator>control9</dc:creator>
<guid>http://control9.wordpress.com/2009/05/28/it-works/</guid>
<description><![CDATA[Максимум двух байт &gt;,&gt;&gt;,&lt;&lt;[-&gt;+&gt;-[&lt;&lt;&lt;]&gt;]&gt;[&gt;&gt;]&lt;&lt;[&gt;]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><em><em>Максимум двух байт</em></em><br />
<strong><strong>&#62;,&#62;&#62;,&#60;&#60;[-&#62;+&#62;-[&#60;&#60;&#60;]&#62;]&#62;[&#62;&#62;]&#60;&#60;[&#62;&#62;]&#60;&#60;[-&#62;+&#60;]&#62;.</strong><br />
</strong><em> </em><em><em>А это уже минимум)))</em></em><br />
<strong><strong>&#62;&#62;,&#62;,&#60;[-&#62;-&#62;+&#60;[&#60;&#60;&#60;]&#62;&#62;]&#62;&#62;[&#62;&#62;&#62;]&#60;&#60;&#60;.</strong></strong><em><br />
Вот такими вещами я порой маюсь в свободное время<br />
</em></p>
<p><em><br />
</em></p>
<p><em><br />
</em></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Altlasten vs. Nostalgie]]></title>
<link>http://hallomarvin.wordpress.com/2009/05/10/altlasten-vs-nostalgie/</link>
<pubDate>Sun, 10 May 2009 14:36:44 +0000</pubDate>
<dc:creator>hallomarvin</dc:creator>
<guid>http://hallomarvin.wordpress.com/2009/05/10/altlasten-vs-nostalgie/</guid>
<description><![CDATA[Hab mal ein bisschen in der Vergangenheit gestöbert, und dabei dieses Video meiner damaligen Band ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hab mal ein bisschen in der Vergangenheit gestöbert, und dabei dieses Video meiner damaligen Band &#8220;<a href="http://www.myspace.com/brainfuckmetal">Brainfuck</a>&#8221; wieder entdeckt. Der langhaarige Gitarrero bin ich vor etwa 4 1/2 Jahren&#8230;</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/HfuCjPxA5A4&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/HfuCjPxA5A4&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[PHP Brainfuck Generator]]></title>
<link>http://ryonsherman.wordpress.com/2009/04/22/php-brainfuck-generator/</link>
<pubDate>Wed, 22 Apr 2009 20:55:12 +0000</pubDate>
<dc:creator>Ryon Sherman</dc:creator>
<guid>http://ryonsherman.wordpress.com/2009/04/22/php-brainfuck-generator/</guid>
<description><![CDATA[&#8220;The Brainfuck language is a programming language noted for its extreme minimalism. Designed t]]></description>
<content:encoded><![CDATA[&#8220;The Brainfuck language is a programming language noted for its extreme minimalism. Designed t]]></content:encoded>
</item>
<item>
<title><![CDATA[Yet another Brainfuck interpreter]]></title>
<link>http://sudharsh.wordpress.com/2009/04/09/yet-another-brainfuck-interpreter/</link>
<pubDate>Thu, 09 Apr 2009 13:17:33 +0000</pubDate>
<dc:creator>sudharsh</dc:creator>
<guid>http://sudharsh.wordpress.com/2009/04/09/yet-another-brainfuck-interpreter/</guid>
<description><![CDATA[Brainfuck is one of those turing complete languages that has no apparent use in the real world. But ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://en.wikipedia.org/wiki/Brainfuck" target="_blank">Brainfuck</a> is one of those turing complete languages that has no apparent use in the real world. But hey, being very very simple with a limited grammar, writing an interpreter should be easy. So here it is, under <a href="http://sam.zoy.org/wtfpl/">WTFPL</a>. The code works (I hope so) with the examples from the Wikipedia <a href="http://en.wikipedia.org/wiki/Brainfuck#Examples">article</a>.</p>
<pre>#include &#60;stdio.h&#62;
#include &#60;error.h&#62;

#include &#60;config.h&#62;

static char cellspace[30000];
static char *data_pointer;

int process_command(char command, FILE *file_ptr)
{
	char c;
	long pos;

	switch(command) {
	case '&#62;':
		++data_pointer;
		break;
	case '&#60;':
		--data_pointer;
		break;
	case '+':
		++*data_pointer;
		break;
	case '-':
		--*data_pointer;
		break;
	case '.':
		putchar(*data_pointer);
		break;
	case ',':
		*data_pointer = getchar();
		break;
	case '[':
		pos = ftell (file_ptr);
		while(*data_pointer != NULL) {
			fseek (file_ptr, pos, SEEK_SET);
			c = getc(file_ptr);
			while( c!= ']' &#38;&#38; c != EOF) {
				process_command(c, file_ptr);
				c = getc(file_ptr);
			}

		}

	}

}

int interpret_source(const char *source) {

	/*
	 *  Allowed brainfuck commands are,
	 *  &#62; 	increment the data pointer (to point to the next cell to the right).
	 *  &#60; 	decrement the data pointer (to point to the next cell to the left).
	 *  + 	increment (increase by one) the byte at the data pointer.
	 *  - 	decrement (decrease by one) the byte at the data pointer.
	 *  . 	output the value of the byte at the data pointer.
	 *  , 	accept one byte of input, storing its value in the byte at the data pointer.
	 *  [ 	if the byte at the data pointer is zero,
	 *      then instead of moving the instruction pointer forward to the next command,
	 *      jump it forward to the command after the matching ] command.
	 *  ] 	if the byte at the data pointer is nonzero,
	 *      then instead of moving the instruction pointer forward to the next command,
         *      jump it back to the command after the matching [ command.
	 */

	char command;
	FILE *file_ptr = fopen(source, "r");

	if (!file_ptr) {
		fprintf(stderr, "Error: No such file %s\n", source);
		return FALSE;
	}

	while((command = getc(file_ptr)) != EOF)
		process_command(command, file_ptr);
	fclose(file_ptr);
	return TRUE;
}

int main(int argc, char **argv)
{
	/* Init data_pointer to the left most cell */
	data_pointer = &#38;cellspace[0];

	/* Use getopts? */
	if (argc &#62; 1)
		interpret_source(argv[1]);
	return 0;
}</pre>
</div>]]></content:encoded>
</item>

</channel>
</rss>
