Oct 01

Program like a Monkey – I mean an Orangutan – It’s OOK!

Learning PowerShell & Python isn’t enough… I need to learn OOK!

Introduction

Ook! is a programming language designed for orang-utans. Ook! is essentially isomorphic to the well-known esoteric language BrainF***, but has even fewer syntax elements.

Design Principles

  • A programming language should be writable and readable by orang-utans.
  • To this end, the syntax should be simple, easy to remember, and not mention the word “monkey”.
  • Bananas are good.

Language Concepts

If you are familiar with BrainF*** you can skip straight to the syntax elements section. Note that since Ook! is trivially isomorphic to BrainF***, it is well-established that Ook! is a Turing-complete programming language.

Memory Array and Pointer

Ook! uses a large array of integers as storage space, all initially set to zero. A Memory Pointer begins pointing at the first array cell.

Comments

Since the word “ook” can convey entire ideas, emotions, and abstract thoughts depending on the nuances of inflection, Ook! has no need of comments. The code itself serves perfectly well to describe in detail what it does and how it does it. Provided you are an orang-utan.

Syntax Elements

Ook! has only three distinct syntax elements:

  • Ook.
  • Ook?
  • Ook!

These are combined into groups of two, and the various pair combinations specify commands. Programs must thus contain an even number of “Ook”s. Line breaks are ignored.

Commands

  • Ook. Ook?
    Move the Memory Pointer to the next array cell.
  • Ook? Ook.
    Move the Memory Pointer to the previous array cell.
  • Ook. Ook.
    Increment the array cell pointed at by the Memory Pointer.
  • Ook! Ook!
    Decrement the array cell pointed at by the Memory Pointer.
  • Ook. Ook!
    Read a character from STDIN and put its ASCII value into the cell pointed at by the Memory Pointer.
  • Ook! Ook.
    Print the character with ASCII value equal to the value in the cell pointed at by the Memory Pointer.
  • Ook! Ook?
    Move to the command following the matching Ook? Ook! if the value in the cell pointed at by the Memory Pointer is zero. Note that Ook! Ook? and Ook? Ook! commands nest like pairs of parentheses, and matching pairs are defined in the same way as for parentheses.
  • Ook? Ook!
    Move to the command following the matching Ook! Ook? if the value in the cell pointed at by the Memory Pointer is non-zero.

Um, that’s it. That’s the whole language. What do you expect for something usable by orang-utans?

Ook Design & Language Specification: http://www.dangermouse.net/esoteric/ook.html

 

 

(Visited 99 times, 1 visits today)