Ook!

Ook!

Ook! ist eine Variante der esoterischen Programmiersprache Brainfuck für Orang-Utans, entwickelt von David Morgan-Mar.[1] Obwohl bei Ook! der humoristische Ansatz im Vordergrund steht, eignet es sich gut dazu einige Grundlagen zum Design von Programmiersprachen zu verdeutlichen. Wie Brainfuck ist auch Ook! Turing-vollständig, obwohl es einen sehr kleinen Syntaxumfang hat.

Inhaltsverzeichnis

Sprachdesign

Die Designkriterien der Sprache sind:

  1. Eine Programmiersprache sollte schreib- und lesbar für Orang-Utans sein.
  2. Die Syntax sollte einfach sein, leicht zu merken und das Wort Monkey (engl. Affe) vermeiden.
  3. Bananen sind gut.

Augenscheinlich ist diese Programmiersprache angelehnt an die Bibliothekarsfigur aus den Scheibenweltromanen von Terry Pratchett (Vergleiche hierzu dessen Eigenschaft, jedes Wort und jeden Satz mit „Ook“ („Ugh“ im Deutschen) ausdrücken zu können und seine Empfindlichkeit, wenn er als „Monkey“ bezeichnet wird – er bevorzugt „Ape“).

Ook hat nur drei Syntaxelemente:

  • Ook.
  • Ook?
  • Ook!

Diese werden zu Zweiergruppen zusammengefasst. Die Ook-Tupel (Ook? Ook? wird nicht verwendet) lassen sich wie Brainfucksymbole nutzen, das ebenfalls nur acht Befehlsbezeichnungen kennt. Jedes Ook!-Programm besteht also aus einer geraden Zahl von Ooks. Zeilenumbrüche werden ignoriert.

Es gibt inzwischen Ook!-Interpreter in Ruby, Python, Perl und C# sowie einen Ook!-zu-Brainfuck- und Brainfuck-zu-Ook!-Konverter in Java, Delphi sowie Brainfuck und Ook! selbst und damit bald mehr Ook!-Interpreter als Ook!-Programme.

Interessant an Ook! ist, dass es formal gesehen identisch mit Brainfuck ist. Die Syntax der beiden Sprachen ist übereinstimmend, lediglich die Darstellung in menschenlesbaren Symbolen unterscheidet sich. Durch die Verwendung der drei „Ook“-Symbole wird die ASCII-Darstellung von Brainfuck auf eine zweistellige ternäre Codierung umgesetzt. Damit wird u. a. verdeutlicht, dass sich formale Sprachen ohne Änderung der Funktion in andere Darstellungen überführen lassen.

Vergleich der Befehlsbezeichnungen von Ook! und Brainfuck

Ook! Brainfuck Beschreibung
Ook. Ook. + den Wert der aktuellen Zelle um 1 erhöhen
Ook! Ook! - den Wert der aktuellen Zelle um 1 verringern
Ook. Ook? > eine Zelle nach rechts gehen
Ook? Ook. < eine Zelle nach links gehen
Ook! Ook? [ Schleifenanfang – die Schleife durchlaufen solange der Wert der aktuellen Zelle ungleich 0 ist
Ook? Ook! ] Schleifenende – beendet die Schleife, wenn der Wert der aktuellen Zelle gleich 0 ist
Ook! Ook. . den Wert der aktuellen Zelle ausdrucken
Ook. Ook! , einen Wert von der Tastatur in die aktuelle Zelle einlesen

Beispielprogramm

Dies ist ein Beispielprogramm, das in Ook! programmiert ist. Es gibt Hello World auf der Standardausgabe aus.

Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.

Einzelnachweise

  1. DM's Esoteric Programming Languages

Weblinks

Dieser Artikel existiert auch als Audiodatei.

Wikimedia Foundation.

Игры ⚽ Поможем написать курсовую

Schlagen Sie auch in anderen Wörterbüchern nach:

  • Ook! — (con el signo de exclamación) es un lenguaje de programación esotérico Turing completo. Este lenguaje es una parodia de Brainfuck, del que toma su conjunto completo de comandos (ver tabla). Deriva su completitud Turing de esta relación. Según su… …   Wikipedia Español

  • Ook — or OOK may refer to: Ook Chung (born 1963), a Korean Canadian writer from Quebec OOK, acronym of on off keying OOK, IATA airport code for Toksook Bay Airport, Alaska Ook language (Discworld), one half of the vocabulary of the fictional orangutan… …   Wikipedia

  • Ook! — (con el signo de exclamación) es un lenguaje de programación esotérico Turing completo diseñado para orangutanes. El lenguaje tiene 3 palabras reservadas (Ook., Ook?, y Ook!); que pueden combinarse en ocho maneras diferentes para formar el… …   Enciclopedia Universal

  • Ook — ([=o]k), n. Oak. [Obs.] A branched ook. Chaucer. [1913 Webster] …   The Collaborative International Dictionary of English

  • OOk — Brainfuck Brainfuck est un langage de programmation minimaliste, inventé par Urban Müller en 1993. Il tire son nom de l’union de deux mots anglais, brain (cerveau) et fuck (foutre), allusion transparente à l expression « masturbation… …   Wikipédia en Français

  • Ook — Brainfuck Brainfuck est un langage de programmation minimaliste, inventé par Urban Müller en 1993. Il tire son nom de l’union de deux mots anglais, brain (cerveau) et fuck (foutre), allusion transparente à l expression « masturbation… …   Wikipédia en Français

  • Ook! — Brainfuck Brainfuck est un langage de programmation minimaliste, inventé par Urban Müller en 1993. Il tire son nom de l’union de deux mots anglais, brain (cerveau) et fuck (foutre), allusion transparente à l expression « masturbation… …   Wikipédia en Français

  • OOK — Die Abkürzung bzw. das Wort OOK steht für: On Off Keying, eine binäre Modulationsart, die einfachste Form der Amplitudentastung Ook!, eine Variante der esoterischen Programmiersprache Brainfuck …   Deutsch Wikipedia

  • Ook — Die Abkürzung bzw. das Wort OOK steht für: On Off Keying, eine binäre Modulationsart, die einfachste Form der Amplitudentastung Ook!, eine Variante der esoterischen Programmiersprache Brainfuck Diese Seite ist eine Begriffsklärung …   Deutsch Wikipedia

  • ook — interjection The cry of a monkey. He tapped the Librarian on the shoulder. Excuse me mdash; Ook? Those guys just called you a monkey, said Glod …   Wiktionary

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”