Cood

Cood (code and food) is an interpreted stack-based esoteric programming language based on the phrases you usually will say in a restaurant.

There are three known official interpreters available, coded in AutoIt, PHP and Javascript.

Documentation
Every script starts with a &quot;Hey, waiter!&quot;, although it is not mandatory.

The programmer has access to 65,535 data cells, starting in pointer 32,767.

Functions
All punctiation (commas, periods) is non-mandatory. It is also possible to indent the code with spaces or tabs. Also, the code will understand if the programmer replaces &quot;I'm&quot; with &quot;I am&quot;.

Loops
In Cood, loops are made using &quot;What do you suggest?&quot; and &quot;Nothing more?&quot;. All the code between these tags is repeated until the current pointer (it must be the current pointer at the time of &quot;Nothing more?&quot; call) is zero. Example:

Hey, waiter! I want 10 of this. What do you suggest? Know a joke? This line will run ten times. I don't want this. Nothing more?

It's worth to remember to always decrease the pointer value (or increase if the code is dealing with negative values), as the loop doesn't decrease it automatically. This is done using &quot;I don't want this.&quot;. Also, the code above won't display anything.

Debugging
Cood also includes a simple line-by-line debugger, accessible by adding "--debug" as second parameter when running the script.

interpreter &quot;My awesome script.cood&quot; --debug

Hello World
This is a simple way to write HelloWorld! by using an ASCII table.

Hey, waiter! I want 72 of this. I'm very hungry. I want 101 of this. I'm very hungry. I want 108 of this. I'm very hungry. I'm very hungry. I want 111 of this. I'm very hungry. I want 32 of this. I'm very hungry. I want 87 of this. I'm very hungry. I want 111 of this. I'm very hungry. I want 114 of this. I'm very hungry. I want 108 of this. I'm very hungry. I want 100 of this. I'm very hungry. I want 33 of this. I'm hungry.

Countdown
As the decimal 0 (zero) value is not the char 0 (zero), and the numbers start at the position 48 on the ASCII char, it is necessary to work with two data cells: the first one, with value 10, will control the loop. The second one, with the value 57 (chr '9'), will be displayed. Remember it is necessary to decrease both the cells' values and move to the right one before the loop ends.

Hey waiter! Know a joke? This is a comment I want 10 of this. What do you have for dessert? I want 57 of this. What do you have for tidbit? What do you suggest? What do you have for dessert? I'm hungry. I don't want this. What do you have for tidbit? I don't want this. Nothing more?

Another example of loop asking for user input.

Hey waiter! Know a joke? This is a comment May I ask something? What do you suggest? What do you have for dessert? I want this. What do you have for dessert? I want this. What do you have for tidbit? What do you have for tidbit? I don't want this. Nothing more? What do you have for dessert? More 48 of this. What do you have for dessert? What do you suggest? What do you have for tidbit? I'm hungry. I don't want this. What do you have for dessert? I don't want this. Nothing more?

Sum
The script below will store the user's numbers in two different cells, then loop one over another, decreasing one of them and increasing the other. For example, if the user inputs the numbers &quot;2&quot; and &quot;3&quot;, it will have two stacks:

"[2] [3]"

When the loop is running:

[2] [3] (initial state)

[1] [4]

[0] [5]

The result is showed on the second stack, and it will be showed as decimal.

Here is the code:

Hey, waiter! Know a joke? This is the sum calculator. May I ask something? What do you have for dessert? May I ask something? What do you suggest? What do you have for tidbit? I want this. What do you have for dessert? I don't want this. Nothing more? What do you have for tidbit? How much is it?

External resources

 * Cood website (with online interpreter)