We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

ORK

From Esolang
Jump to navigation Jump to search

ORK (Objekts R Kool), designed by Gregor Richards in 2005, is an object-oriented language that has a very verbose syntax, unlike most other esoteric programming languages. It's object oriented to such a degree, that even simple operations (addition, subtraction, comparisons) require the instantiation of an object. According to the spec, its divine purpose in existance is to be the polar opposite of Brainfuck.

Examples

Hello, world!

When this program starts:
There is a scribe called Writer.
Writer is to write "Hello, world!"

Interpret this online

Cat

(in the spirit of the language this program is excessively verbose)

There is such a thing as a mouse.
A mouse can be_eaten.
A mouse has a status which is a word.
A mouse has a voice which is a scribe.
A mouse has an input which is an inputter.

When a mouse is to be_eaten:
There is a word called squeaky sound.
input is to readOne squeaky sound.
If input says it's done then status is "eaten".
voice is to write squeaky sound.

There is such a thing as a cat.
A cat can eat a mouse.
A cat has a Lingo which is a linguist

When a cat is to eat a mouse:
The mouse is to be_eaten.
Lingo's first operand is the mouse's status.
Lingo's second operand is "eaten".
Lingo is to compare.
If Lingo says it's not equal then I am to loop.

When this program starts:
There is a cat called Lucifer Sam.
There is a mouse called Gerald.
Gerald's status is "alive".
Lucifer Sam is to eat Gerald.

Interpret this online

One Time Cat

Being as succinct as possible, against the spirit of the language.

When this program starts:
There is a word called x.
There is an inputter called y.
There is a scribe called z.
y is to readOne x.
z is to write x.

Interpret this online

Truth Machine

There is such a thing as a truth machine.

When a truth machine is to zero:
There is a scribe called z.
z is to write 0.

When a truth machine is to one:
There is a scribe called z.
z is to write 1.
I am to loop

When a truth machine is to run a word:
There is a linguist called l.
l's first operand is the word.
l's second operand is "0".
l is to compare.
If l says it's equal then I am to zero.
If l says it's not equal then I am to one.

When this program starts:
There is a word called x.
There is an inputter called y.
y is to readOne x.
There is a truth machine called t.
t is to run x.

Interpret this online

Quine

There's a quine in the Esoteric File Archive, but User:None1 has written a much shorter and much more readable quine without golfing:

There is such a thing as a parrot.
A parrot has a name which is a word.
A parrot has a memory which is a number array.
A parrot has a tongue which is a scribe.
A parrot has a state which is a number.
A parrot has a brain which is a mathematician.
A parrot can learn a word.
A parrot can speak.
A parrot can feed.
A parrot can imitate.

When a parrot is to learn a word:
My name is the word.
My memory is to import the word.

When a parrot is to speak:
My tongue is to asciiWrite 34.
My tongue is to write my name.
My tongue is to asciiWrite 34.
My state is 0.

When a parrot is to feed:
My tongue is to asciiWrite 10.
My state is 0.

When a parrot is to imitate:
My brain's first operand is my memory's current.
My brain's second operand is my memory's length.
My brain is to compare.
If my brain says it's equal then I am to quit.
I have a number called char.
My memory is to get char.
My state is 1.
My brain's first operand is char.
My brain's second operand is 36.
My brain is to compare.
If my brain says it's equal then I am to speak.
My brain's first operand is char.
My brain's second operand is 64.
My brain is to compare.
If my brain says it's equal then I am to feed.
My brain's first operand is my state.
My brain's second operand is 1.
My brain is to compare.
If my brain says it's equal then my tongue is to asciiWrite char.
My brain's first operand is my memory's current.
My brain's second operand is 1.
My brain is to add.
My memory's current is my brain's result.
I am to loop.

When this program starts:
There is a parrot called P.
P is to learn "There is such a thing as a parrot.@A parrot has a name which is a word.@A parrot has a memory which is a number array.@A parrot has a tongue which is a scribe.@A parrot has a state which is a number.@A parrot has a brain which is a mathematician.@A parrot can learn a word.@A parrot can speak.@A parrot can feed.@A parrot can imitate.@@When a parrot is to learn a word:@My name is the word.@My memory is to import the word.@@When a parrot is to speak:@My tongue is to asciiWrite 34.@My tongue is to write my name.@My tongue is to asciiWrite 34.@My state is 0.@@When a parrot is to feed:@My tongue is to asciiWrite 10.@My state is 0.@@When a parrot is to imitate:@My brain's first operand is my memory's current.@My brain's second operand is my memory's length.@My brain is to compare.@If my brain says it's equal then I am to quit.@I have a number called char.@My memory is to get char.@My state is 1.@My brain's first operand is char.@My brain's second operand is 36.@My brain is to compare.@If my brain says it's equal then I am to speak.@My brain's first operand is char.@My brain's second operand is 64.@My brain is to compare.@If my brain says it's equal then I am to feed.@My brain's first operand is my state.@My brain's second operand is 1.@My brain is to compare.@If my brain says it's equal then my tongue is to asciiWrite char.@My brain's first operand is my memory's current.@My brain's second operand is 1.@My brain is to add.@My memory's current is my brain's result.@I am to loop.@@When this program starts:@There is a parrot called P.@P is to learn $.@P is to imitate.".
P is to imitate.

Interpret this online

Deadfish

By User:None1.

There is such a thing as a fish.
A fish has a register which is a number.
A fish has a voice which is a scribe.
A fish has a brain which is a mathematician.
A fish has an eye which is a number.
A fish has an input which is an inputter.
A fish can validate.
A fish can add.
A fish can subtract.
A fish can square.
A fish can output.
A fish can interpret.

When a fish is to validate:
brain's first operand is register.
brain's second operand is 256.
brain is to compare.
If brain says it's equal then register is 0.
brain's first operand is register.
brain's second operand is -1.
brain is to compare.
If brain says it's equal then register is 0.

When a fish is to add:
brain's first operand is register.
brain's second operand is 1.
brain is to add.
register is brain's result.
I am to validate.

When a fish is to subtract:
brain's first operand is register.
brain's second operand is 1.
brain is to subtract.
register is brain's result.
I am to validate.

When a fish is to square:
brain's first operand is register.
brain's second operand is register.
brain is to multiply.
register is brain's result.
I am to validate.

When a fish is to output:
voice is to write register.
voice is to asciiWrite 10.

When a fish is to interpret:
input is to readOne eye.
If input says it's done then I am to quit.
brain's first operand is eye.
brain's second operand is 105.
brain is to compare.
If brain says it's equal then I am to add.
brain's first operand is eye.
brain's second operand is 100.
brain is to compare.
If brain says it's equal then I am to subtract.
brain's first operand is eye.
brain's second operand is 115.
brain is to compare.
If brain says it's equal then I am to square.
brain's first operand is eye.
brain's second operand is 111.
brain is to compare.
If brain says it's equal then I am to output.
I am to loop.

When this program starts:
There is a fish called Deadfish.
Deadfish's register is 0.
Deadfish is to interpret.

Try this online

External resources