Examples:
||
||
step(s), ms
Permalink. || bytes, chars || Status: awaiting code
Note: Run is limited to 1 minute at a time and Slow
is limited to a total of 1000 steps or 1 minute, whichever is shorter.
Current instruction:
Input:
Output:
Stack:
Loops:
Register: 0
(Empty space.) Lets the program counter move through time (fall to the next layer).#
Net; stops the program counter from moving through time (it's a no-op).v
Directs the program counter down.<
Directs the program counter left.>
Directs the program counter right.^
Directs the program counter up./
A mirror that acts like you would expect.\
A mirror that acts like you would expect._
A horizontal mirror; horizontal trajectories are unaffected.|
A vertical mirror; vertical trajectories are unaffected.!
Unconditional single-space trampoline.?
Conditional single-space trampoline; pops t
and jumps if t
is truthy.@
Unconditional n-space trampoline; pops n
and jumps that many spaces.&
Conditional n-space trampoline; pops n
, t
and jumps n
spaces if t
is truthy.V
Boost; enables the program counter to cross any number of spaces.
$V
enables the boost permanently until it encounters another V
.w
Space wormhole; pops y
,x
and jumps to (x,y)
in the codebox.$w
Space-time wormhole; pops t
,y
,x
and jumps to (x,y,t)
in the codebox..
Stop.$.
Pause. (Useful for online interpreter only.)C
Comment; ignores everything until the next C
.b
Straight branch; pops t
and continues forward if truthy, backwards otherwise.$b
Reversed straight branch; pops t
and continues forward if falsy, backwards otherwise.B
T branch; pops t
and turns right (clockwise) if truthy, left (counterclockwise) otherwise.$B
Reversed T branch; pops t
and turns right (clockwise) if falsy, left (counterclockwise) otherwise.t
Ternary; expects code to be arranged like this: t...t...t
. Pops n
and runs the first segment if 0; runs the second segment otherwise.
f
Gosub return; jumps back to where F
was used last.F
Gosub jump in 2D; pops y
,x
and jumps to (x,y)
in the codebox.$F
Gosub jump in 3D; pops t
,y
,x
and jumps to (x,y,t)
in the codebox.(
Opens while loop; takes all of parent's stack.$(
Opens while loop; pops n
and takes the top n
elements of parent's stack.)
Closes while loop; pops t
and jumps back to the opening (
if truthy, continues forward otherwise, extending parent stack with current stack.[
Opens for loop; pops n
and repeats the body n
times; takes all of parent's stack.$[
Opens for loop; pops n
and repeats the body n
times; then also pops k
and takes the top k
elements of parent's stack.]
Closes for loop and extends parent stack with current stack.{
Starts a new recursion if not already in a recursion; jumps back to the initial {
otherwise. Pops n
when initialized and takes the top n
elements of parent stack on every iteration.${
Starts a new recursion no matter what. Pops n
when initialized and takes the top n
elements of parent stack on every iteration.}
Returns; that is, closes current recursion level and extends parent stack with current stack.k
Break; breaks out of the current loop or recursion and extends parent stack with current stack.$k
Break; breaks out of the current loop or recursion and throws away the current stack.K
Sends the program counter in a random direction.$K
Sends the program counter in a random direction, possibly forward in time.0...9,l,j
Pushes the corresponding digit onto the stack (where the lowercase L l
is 10 and j
is sqrt(-1)
).$1...$6
Pushes the corresponding numbers 11 through 16 onto the stack.$0
Pushes 0.1 onto the stack.$7
Pushes 0.5 onto the stack.$8
Pushes phi (the golden ratio) onto the stack.$9
Pushes sqrt(2) onto the stack.$l
Pushes 100 onto the stack.$j
Pushes (1/sqrt(2) + 1/sqrt(2)j) onto the stack."..."
String literal; Minkolang is smart enough to reverse this before pushing on the stack.$"..."
String literal with escapes; all escape sequences are converted before pushing on the stack.'...'
Number literal; does the work of multiplying by 10 and adding the next digit.$'...'
Number literal with a specific base; pops n
before the literal and converts from base n
to base 10
before pushing on the stack.L
Range; pops b
,a
and pushes onto the stack every number from a
to b
in increments of 1, inclusive.$L
Range with step; pops s
,b
,a
and pushes onto the stack every number from a
to b
in increments of s
, inclusive.h
Pops n
and pushes a random integer between 0
and n
, inclusive.$h
Pops n
and pushes a random float between 0
and n
, inclusive.H
Pops b
,a
and pushes a random integer between a
and b
, inclusive.$H
Pops b
,a
and pushes a random float between a
and b
, inclusive.+
Add; pops b
,a
and pushes a+b
.$+
Sum; clears the stack and pushes its sum.-
Subtract; pops b
,a
and pushes a-b
.$-
Sign; pops a
and pushes 1
if a
is positive, -1
if a
is negative, 0
otherwise.*
Multiply; pops b
,a
and pushes a*b
.$*
Product; clears the stack and pushes the product of its elements.:
Integer division; pops b
,a
and pushes a//b
.$:
Float division; pops b
,a
and pushes a/b
.;
Exponentiation; pops b
,a
and pushes a**b
.$;
Logarithm; pops b
,a
and pushes log_a(b)
.%
Modulo; pops b
,a
and pushes a%b
.$%
Divmod; pops b
,a
and pushes a//b
, a%b
.~
Negation; pops a
and pushes -a
.$~
Absolute value; pops a
and pushes abs(a)
.=
Equality; pops b
,a
and pushes a == b
.$=
Equivalence (modulo); pops n
,b
,a
and pushes a == b (mod n)
.`
Greater than; pops b
,a
and pushes a > b
.$`
Less than; pops b
,a
and pushes a < b
.,
Not; pops a
and pushes not(a)
.$,
Boolean; pops a
and pushes bool(a)
.y
Int; pops a
and pushes int(a)
.$y
Float; pops a
and pushes a-int(a)
.Y
Floor; pops a
and pushes floor(a)
.$Y
Ceiling; pops a
and pushes ceil(a)
.o
Takes character from input. If input is empty, pushes 0 onto the stack.$o
Reads in all of input as characters. If input is empty, pushes 0 onto the stack.O
Pops top of stack and outputs as character.$O
Outputs all of stack as characters.n
Takes number (int, float, complex) from input. Dumps characters from input until a valid input is found. If not, pushes -1 onto the stack.$n
Takes all numbers (int, float, complex) from input. Dumps characters from input until a valid input is found. If not, pushes -1 onto the stack.N
Pops top of stack and outputs as number (int, float, complex).$N
Outputs all of stack as numbers (int, float, complex).d
Duplicates top element of stack.$d
Duplicates whole stack.D
Multi-duplicate; pops n
and duplicates the top of stack n
times.$D
Multi-duplicate; pops n
and duplicates whole stack n
times.g
Stack get; pops n
and gets the stack's n
th element and puts it on top of stack.$g
Stack slice; pops b
,a
and puts stack[a:b]
on top of stack.G
Stack insert; pops n
,x
and inserts x
at the n
-th position (zero-indexed).$G
Stack multi insert; pops b
,a
and inserts the top b
elements at index a
.c
Stack copy; pops n
and copies the n
-th element to the top of stack.$c
Stack copy-slice; pops b
,a
and copies stack[a:b]
to the top of stack.i
Gets loop's counter (0-based) and pushes it onto the stack.$i
(For loops only.) Gets for loop's max number of iterations and pushes it onto the stack.I
Pushes the stack's length onto the stack.$I
Pushes the input's length onto the stack.r
Reverses stack.$r
Swaps top two elements of stack.R
Rotates stack; pops n
and rotates clockwise n
times (may be negative).s
Sorts the stack.
$s
Sort some; pops n
and sorts the top n
elements of the stack.S
Duplicate removal; "Hello world!"S(O).
will give you Hel wrd!
.
$S
Partial duplicate removal; pops n
and removes duplicates from the top n
elements of the stack.x
Dump; pops the top of stack and throws it away.$x
Front dump; pops the bottom (or front) of stack and throws it away.X
N-dump; pops n
and throws away the top n
elements of the stack.
$X
Front N-dump; pops n
and throws away the bottom (or front) n
elements of the stack.
p
Puts to codebox; pops k
,y
,x
and replaces Code(x,y)
with k
.$p
Multi-level puts to codebox; pops k
,t
,y
,x
and replaces Code(x,y,t)
with k
.q
Get from codebox; pops y
,x
and pushes Code(x,y)
on stack.$q
Multi-level get from codebox; pops t
,y
,x
and pushes Code(x,y,t)
on stack.a
Array get; pops y
,x
and pushes Array[y][x]
on stack.A
Array put; pops k
,y
,x
and writes k
to Array[y][x]
.z
Register get; pushes the value of the register onto the stack.$z
Register set; pops n
and sets the value of the register to n
.$
Toggles the functionality of many functions. This "toggle flag" only remains active for one step.$$
Toggles functionality permanently until another $
is encountered.$$$
Separates layers of a program.u
Debug (print) the current stack (Python interpreter only).$u
Debug (print) the code and loops (Python interpreter only).0M
Factorial; pops a
and pushes a!
.0$M
Gamma; pops a
and pushes Γ(a)
.1M
Square root; pops a
and pushes sqrt(a)
.1$M
Nth root; pops a
,r
and pushes (a)**(1/r)
.2M
Is prime; pops a
and pushes 1 if a
is prime, 0 otherwise.2$M
Is composite; pops a
and pushes 1 if a
is composite, 0 otherwise.3M
Nth prime; pops n
and pushes the n
th prime number.3$M
Nth composite; pops n
and pushes the n
th composite number.4M
GCD; pops b
,a
and pushes gcd(a,b)
.4$M
LCM; pops b
,a
and pushes lcm(a,b)
.5M
Mean; pops the whole stack and pushes its mean.5$M
Standard deviation; pops the whole stack and pushes its population standard deviation.6M
Binomial (nCr); pops b
,a
and pushes a C b
.6$M
Permutation (nPr); pops b
,a
and pushes a P b
.7M
Real/imag; pops z
and pushes its real and imaginary parts, in that order.7$M
Complex conjugate; pops z
and pushes its conjugate.8M
2D distance; pops y2
,x2
,y1
,x1
and pushes the distance from (x1,y1)
to (x2,y2)
.8$M
N-D distance; pops n
, then pops the next 2n
elements (treats them as (x1,y1,...),(x2,y2,...)) and pushes the distance between them.9M
Pi(x) (prime counting); pops a
and pushes pi(a)
.9$M
Phi(x) (totient); pops a
and pushes totient(a)
.lM
log(x); pops a
and pushes log(a)
(natural log).l$M
log_b(x); pops b
,a
and pushes log_b(a)
.0T
Pi; pushes pi
.0$T
e (Euler's number); pushes e
.1T
Radians; pops a
and pushes a*pi/180
.1$T
Degrees; pops a
and pushes a*180/pi
.2T
Sine; pops a
and pushes sin(a)
.2$T
Arcsine; pops a
and pushes asin(a)
.3T
Cosine; pops a
and pushes cos(a)
.3$T
Arccosine; pops a
and pushes acos(a)
.4T
Tangent; pops a
and pushes tan(a)
.4$T
Arctangent; pops a
and pushes atan(a)
.5T
Atan2; pops y
,x
and pushes atan2(y,x)
.5$T
Hypotenuse; pops y
,x
and pushes hypot(x,y)
.6T
Angle difference - angles; pops b
,a
and pushes the signed angle difference between a
and b
.6$T
Angle difference - coordinates; pops y2
,x2
,y1
,x1
and pushes the signed angle difference between (x1,y1)
and (x2,y2)
.7T
Hyperbolic sine; pops a
and pushes sinh(a)
.7$T
Hyperbolic arcsine; pops a
and pushes asinh(a)
.8T
Hyperbolic cosine; pops a
and pushes cosh(a)
.8$T
Hyperbolic arccosine; pops a
and pushes acosh(a)
.9T
Hyperbolic tangent; pops a
and pushes tanh(a)
.9$T
Hyperbolic arctangent; pops a
and pushes atanh(a)
.0Z
Count single item; pops a
and pushes how many instances of a
are on the stack.0$Z
Count multi item; pops n
, then pops the next n
elements and pushes how many instances of that list are on the stack.1Z
Find first single item; pops a
and pushes the first index of a
on the stack. Pushes -1 if not found.1$Z
Find first multi item; pops n
, then pops the next n
elements and pushes the first index of that list on the stack. Pushes -1 if not found.2Z
Find all single item; pops a
and pushes each index of a
on the stack, along with the count. Pushes 0 if not found.2$Z
Find all multi item; pops n
, then pops the next n
elements and pushes each index of that list on the stack, along with the count. Pushes 0 if not found.3Z
Remove first single item; pops a
and deletes the first occurence of a
on the stack.3$Z
Remove first multi item; pops n
, then pops the next n
elements and deletes the first occurrence of that list on the stack.4Z
Remove all single item; pops a
and deletes each occurrence of a
on the stack.4$Z
Remove all multi item; pops n
, then pops the next n
elements and deletes each occurrence of that list on the stack..5Z
Replace first multi item; pops b
,a
, then pops the next b
elements (B
) and the next a
elements (A
), then replaces the first instance of A
with B
.5$Z
Replace all multi item; pops b
,a
, then pops the next b
elements (B
) and the next a
elements (A
), then replaces every instance of A
with B
.6Z
Convert number to string; pops n
and pushes its string representation onto the stack.6$Z
Convert string to number; pops the whole stack and pushes its numerical representation onto the stack.7Z
Lowercase; lowercases all alphabetic characters.7$Z
Uppercase; uppercases all alphabetic characters.8Z
Is alphanumeric; pushes 1 if the whole stack has only alphanumeric characters, 0 otherwise.8$Z
Switch case; switches all alphabetic characters from uppercase to lowercase and vice versa.9Z
Is alpha; pushes 1 if the whole stack has only alphabetic characters, 0 otherwise.9$Z
Is decimal; pushes 1 if the whole stack has only decimal characters, 0 otherwise.lZ
Alphabet; pushes the uppercase and lowercase alphabet.l$Z
Numbers; pushes the numeric digits.jZ
Minimum; pushes the minimum of the stack.j$Z
Maximum; pushes the maximum of the stack.
A note: matrices are stored in the following manner: a stack of [12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 4, 3]
corresponds to
1 2 3 4 5 6 7 8 9 10 11 12That is, the elements of the matrix are stored in reverse reading order (i.e. right to left, bottom to top), the top element of the stack is the number of rows and the next topmost element element is the number of columns. Any elements needed after the stack is exhausted will be zero. All matrix operations assume the matrices have been properly stored.
0P
Matrix output as numbers; pops A
and outputs the elements of A
as numbers, space separated and with newlines between each row.0$P
Matrix output as characters; pops A
and outputs the elements of A
as characters, with newlines between each row.1P
Matrix addition; pops B
,A
and pushes A+B
. A mismatch in dimensions throws an error.1$P
Matrix addition, loose; pops B
,A
and pushes A+B
. Matrices are padded with zeros if dimensions don't match.2P
Matrix subtraction; pops B
,A
and pushes A-B
. A mismatch in dimensions throws an error.2$P
Matrix subtraction, loose; pops B
,A
and pushes A-B
. Matrices are padded with zeros if dimensions don't match.3P
Matrix multiplication; pops B
,A
and pushes AB
. A mismatch in dimensions throws an error.3$P
Scalar multiplication; pops b
,A
and pushes bA
.4P
Matrix division; pops B
,A
and pushes A*inverse(B)
. A mismatch in dimensions throws an error.4$P
Scalar division; pops b
,A
and pushes A/b
.5P
Matrix transpose; pops A
and pushes the transpose of A
.5$P
Matrix rotate/flip; pops n
,A
and rotates A
n*90
degrees clockwise, transposing first if n > 3
.6P
Identity matrix; pops n
and pushes the n
by n
identity matrix.6$P
Matrix fill; pops y
,x
,n
and pushes an x
by y
matrix where every element is n
.7P
Matrix determinant; pops A
and pushes the determinant of A
. An error is thrown if A
is not square.8P
Matrix inverse; pops A
and pushes the inverse of A
. An error is thrown if A
is not square.9P
Scalar exponentiation; pops n
,A
and pushes A^n
.$1P
Row sums; pops A
and pushes the sums of the rows of A
.$1$P
Column sums; pops A
and pushes the sums of the columns of A
.$2P
Submatrix row slice; pops q
,p
,A
and pushes rows p
to q
of A
, inclusive and zero-indexed.$2$P
Submatrix column slice; pops q
,p
,A
and pushes columns p
to q
of A
, inclusive and zero-indexed.$3P
Row deletion; pops n
,A
and deletes row n
of A
, zero-indexed.$3$P
Column deletion; pops n
,A
and deletes column n
of A
, zero-indexed.0J
And; pops b
,a
and pushes a&b
.1J
Or; pops b
,a
and pushes a|b
.2J
Xor; pops b
,a
and pushes a^b
.3J
Nand; pops b
,a
and pushes not a&b
.4J
Nor; pops b
,a
and pushes not a|b
.5J
Xnor; pops b
,a
and pushes not a^b
.6J
Complement; pops a
and pushes ~a
.7J
If; pops b
,a
and pushes b
if a
, else 1
.7$J
Not if; pops b
,a
and pushes b
if not a
, else 1
.8J
Bitshift left once; pops a
and pushes a<<1
.8$J
Bitshift left n times; pops n
,a
and pushes a<<n
.9J
Bitshift right once; pops a
and pushes a>>1
.9$J
Bitshift left n times; pops n
,a
and pushes a>>n
.Note: for each itertool function (the first four), the input iterables are preceded by a number that denotes how many elements the iterable has. Each item in the output of each itertool function is preceded by a number that denotes its length, and the whole output by a number that denotes its length.
0Q
All self Cartesian product; pops r
,k
, then pops the next k
elements as L
and pushes itertools.product(L, repeats=r)
.0$Q
Nth self Cartesian product; pops n
,r
,k
, then pops the next k
elements as L
and pushes itertools.product(L, repeats=r)[n]
.1Q
All multi Cartesian product; pops r
,q
, then q
times, pops k
and pops the next k
elements as L#
, then pushes itertools.product(L1, L2, L3, ..., repeats=r)
.1$Q
Nth multi Cartesian product; pops n
,r
,q
, then q
times, pops k
and pops the next k
elements as L#
, then pushes itertools.product(L1, L2, L3, ..., repeats=r)[n]
.2Q
All permutations; pops k
, then pops the next k
elements as L
, then pushes itertools.permutations(L)
.2$Q
Nth permutation; pops n
,k
, then pops the next k
elements as L
, then pushes itertools.permutations(L)[n]
.3Q
All combinations without replacement; pops r
,k
, then pops the next k
elements as L
, then pushes itertools.combinations(L,r)
.3$Q
Nth combination without replacement; pops n
,r
,k
, then pops the next k
elements as L
, then pushes itertools.combinations(L,r)[n]
.4Q
All combinations with replacement; pops r
,k
, then pops the next k
elements as L
, then pushes itertools.combinations_with_replacement(L,r)
.4$Q
Nth combination with replacement; pops n
,r
,k
, then pops the next k
elements as L
, then pushes itertools.combinations_with_replacement(L,r)[n]
.