Lesson 6
Ook! is brainfuck in other clothes
Ook! is brainfuck spelled with pairs of orangutan words. Each of brainfuck's eight commands becomes two words.
The lesson
Ook. Ook. is +, Ook! Ook! is -, Ook. Ook? is >, Ook? Ook. is <, Ook! Ook. is ., Ook. Ook! is ,, Ook! Ook? is [ and Ook? Ook! is ].
In these lessons a language is a dictionary of reading rules for one machine, the kernel. Ook!'s dictionary has the same eight rule bodies as brainfuck's; only the patterns differ. The example is the copy loop ,[.,].
Ook! has its own page, and Run opens this example in the editor.
Example
Output
Exercise 1
In Ook!, read a byte and print the byte after it.
Run tries your program on the input below. Check runs it on every test.
| Input | Expected output |
|---|---|
a | b |
N | O |
4 | 5 |
Output
A hint
Brainfuck ,+. reads, adds and prints.
One answer
Answer: In Ook!, read a byte and print the byte after it.
Expected output
b
| Input | Expected output |
|---|---|
a | b |
N | O |
4 | 5 |
Output
Exercise 2
In Ook!, print every input byte twice.
Run tries your program on the input below. Check runs it on every test.
| Input | Expected output |
|---|---|
ab | aabb |
Ook | OOookk |
x y | xx yy |
Output
A hint
Brainfuck ,[..,], word pair by word pair.
One answer
Answer: In Ook!, print every input byte twice.
Expected output
aabb
| Input | Expected output |
|---|---|
ab | aabb |
Ook | OOookk |
x y | xx yy |
Output