Minimal operation language

From Esolang
Jump to navigation Jump to search
Not to be confused with Minimal.

Minimal operation language is a test esolang by User:PythonshellDebugwindow.


Each line is a sequence of unsigned integers of arbitrary size separated by operators (other than lines with goto), e.g.:

1 + 2 - 3 * 4 / 5

Spaces (other than newlines) don't matter. The result of each line is printed to STDOUT with a newline, so the above code would print:


because with Minimal operation language's OOO (see #Operators), and / being floor division:

(1 + 2) - ((3 * 4) / 5) = 0.6

Any question marks will be replaced with user input with the prompt ? , e.g.:


is a numeric cat program. Also:


with input 7 gives:


or with input 123 gives:


or with input abc gives:


because abc is not a valid integer in Minimal operation language (regex: [0-9]+, no preceding + allowed).


Operator Operation Precedence
+ Addition 5
- Subtraction 6
* Multiplication 3
/ Floor division 4
^ Exponentiation 2
( Grouping 1
) Grouping 1
== Equality 7
!= Inequality 8

Precedence is 1 for highest, meaning the higher the precedence, the sooner that operation will be solved. The subtraction operator returns the absolute value of its result, the equality operator returns 1 if its LHS and RHS are the same, otherwise 0, and the inequality operator returns 0 if its LHS and RHS are the same, otherwise 1.


When a line starts with : (colon), the program will jump to the (0-based) Nth line of the program, where N is the number on the line after evaluation (minus the colon). The number on the line will not be printed, and jumping to an out-of-range line will terminate the program without an error. If a line starts with ; (semicolon) instead of :, then the number on the line will be printed before the jump, e.g.:

1 + 1

would print out 2 forever, and:

1 + 1

would print out 2 (followed by 0) forever (2\n0\n2\n0...).

Conditional gotos

If you prefix a : or ; with a number, then the jump will only happen if that left number is not equal to 0. If a : is used, then no value will be printed out, even if the left number is equal to 0, but if a ; is used, then the right value will be printed out. For example:


will print out 0 if user input is invalid or equal to 0, and will print out 1 otherwise. This example can be easily modified into a truth-machine.


Numeric cat


Add two inputs

? + ?