esolang
Learn · LessonsLesson 6 of 18

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.

The tests they must pass
InputExpected output
ab
NO
45

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
The tests they must pass
InputExpected output
ab
NO
45

Output


Exercise 2

In Ook!, print every input byte twice.

Run tries your program on the input below. Check runs it on every test.

The tests they must pass
InputExpected output
abaabb
OokOOookk
x yxx yy

Output


A hint

Brainfuck ,[..,], word pair by word pair.

One answer

Answer: In Ook!, print every input byte twice.

Expected output

aabb
The tests they must pass
InputExpected output
abaabb
OokOOookk
x yxx yy

Output


Read more