For faster navigation, this Iframe is preloading the Wikiwand page for Ook!.

Ook!

aus Wikipedia, der freien Enzyklopädie

Ook! ist eine Variante der esoterischen Programmiersprache Brainfuck für Orang-Utans, entwickelt von David Morgan-Mar.[1][2] 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.

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 (2-Tupeln) 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, Object Pascal sowie Brainfuck und Ook! selbst.

Ook! ist formal gesehen identisch mit Brainfuck. Die Syntax der beiden Sprachen ist übereinstimmend, lediglich die Darstellung in den Symbolen unterscheidet sich. Durch die Verwendung der drei „Ook“-Symbole wird die ASCII-Darstellung von Brainfuck auf eine zweistellige ternäre Codierung umgesetzt[3]. 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

[Bearbeiten | Quelltext bearbeiten]
Ook! 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

[Bearbeiten | Quelltext bearbeiten]

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.

Dies ist ein Beispielprogramm, das in der vereinfachten Variante von Ook! die Standardausgabe Hello World! ausgibt.

. ? . . . . . . . . . . . . . .
. . . . ! ? ? . . . . . . . . .
. . . . . . . . . ? ! ! ? ! ? .
! . . ? . . . . . . . . . . . .
. . ! ? ? . . . . . . . . . . ?
! ! ? ! ? . . . ! . . . . . . .
. . . . . . . . ! . ! . . . . .
. . ! . . ? . ? . ? . . . . . .
. . . . . . . . . . ! ? ? . . .
. . . . . . . ? ! ! ? ! ? . ! .
. ? . ? . ? . . . . . . . . . .
. . . . . . . . . . ! ? ? . . .
. . . . . . . . . . . . . . . .
. ? ! ! ? ! ? . ! ! ! ! ! ! ! .
? . ? . ? . ? . ! . . . . . . .
! . ! ! ! ! ! ! ! ! ! ! ! ! ! .
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
! . . ? . ? . . ! .

Einzelnachweise

[Bearbeiten | Quelltext bearbeiten]
  1. DM's Esoteric Programming Languages
  2. Camille Paloque-Bergès: Poétique des codes sur le réseau informatique, Paris 2008, S. 73
  3. Eine dreistellige binäre Codierung von Brainfuck liegt beispielsweise der Sprache Hohoho! zugrunde, welche speziell auf die Bedürfnisse von Weihnachtsmännern zugeschnitten ist [1].
{{bottomLinkPreText}} {{bottomLinkText}}
Ook!
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?