Ook!

from Wikipedia, the free encyclopedia

Ook! is a variant of the esoteric programming language Brainfuck for orangutans , developed by David Morgan-Mar. Although with Ook! If the humorous approach is in the foreground, it is a good way to clarify some basics of programming language design. Like Brainfuck is also Ook! Turing-complete , although it has a very small syntax.

Language design

The design criteria of the language are:

  1. A programming language should be writable and readable for orangutans.
  2. The syntax should be simple, easy to remember and avoid the word monkey.
  3. Bananas are good.

Apparently, this programming is based on the librarian character from the Discworld novels by Terry Pratchett (compare this to the property, every word and every sentence to) express the Germans with "Ook" ( "Ugh" and when he refers to his sensitivity as "Monkey" becomes - he prefers "Ape").

Ook! has only three syntax elements:

  • Ook.
  • Ook?
  • Ook!

These are combined into groups of two (2- tuples ). The Ook tuple ( Ook? Ook? Is not used) can be used like brainfuck symbols , which also only knows eight command names. Every ook! - The program consists of an even number of ooks. Line breaks are ignored.

There is now Ook! - Interpreter in Ruby , Python , Perl and C # as well as an Ook! -zu- Brainfuck - and Brainfuck -zu- Ook! -Converter in Java , Object Pascal as well as Brainfuck and Ook! self.

Ook! is formally identical to Brainfuck . The syntax of the two languages ​​is the same, only the representation in the symbols differs. By using the three "Ook" symbols, the ASCII representation by Brainfuck is converted to a two-digit ternary coding. This makes it clear, among other things, that formal languages ​​can be converted into other representations without changing their function.

Comparison of the command names of Ook! and brainfuck

Ook! Ook! Brainfuck description
Ook. Ook. . . + increase the value of the current cell by 1
Ook! Ook! ! ! - decrease the value of the current cell by 1
Ook. Ook? . ? > go one cell to the right
Ook? Ook. ? . < go one cell to the left
Ook! Ook? ! ? [ Start of loop - run through the loop as long as the value of the current cell is not equal to 0
Ook? Ook! ? ! ] End of loop - ends the loop when the value of the current cell equals 0
Ook! Ook. ! . . print the value of the current cell
Ook. Ook! . ! , read a value from the keyboard into the current cell

Sample program

This is a sample program used in Ook! programmed. There is Hello World! on standard output.

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

simplification

This is a sample program that is used in the simplified version of Ook! the standard edition Hello World! issues.

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

Individual evidence

  1. ^ DM's Esoteric Programming Languages
  2. Camille Paloque-Bergès: Poétique the codes sur le réseau informatique , Paris 2008, p 73
  3. A three-digit binary code from Brainfuck is, for example, the language Hohoho! which is specially tailored to the needs of Santa Clauses [1] .

Web links