Commands are seperated by newlines (hitting the enter key).
Parameters of a command are space seperated integers (and other things) on the same line after the command
Whitespace before and after a command will be ignored.
Create comments with ", and a breakpoint with !!!
Standard | ||||
---|---|---|---|---|
command | description | parameters required | arguments required | |
10 | places 10/1 on top of the stack -10 also works |
none | none | |
3/5 | places 3/5 on top of the stack -3/5 also works |
none | none | |
1/0 | places ∞ on top of the stack -1/0 also works |
none | none | |
0.2 | places 1/5 on top of the stack -0.2 also works |
none | none | |
0.1[6] | places 1/6 on top of the stack -0.1[6] also works |
none | none | |
+ | addition | none | 2 rationals | |
matrix addition | none | 2 matrices | ||
- | subtraction | none | 2 rationals | |
* | multiplication | none | 2 rationals | |
scale matrix | none | 1 matrix and 1 rational (order doesn't matter) | ||
matrix multiplication | none | 2 matrices (columns of 1st = rows of 2nd) | ||
/ | division | none | 2 rationals | |
int | integer part | none | 1 rational | |
floor | rounds down | none | 1 rational | |
ceil | rounds up | none | 1 rational | |
den | extracts denominator | none | 1 rational | |
% | modulus | none | 2 rationals | |
gcd | greatest common divisor | none | 2 integers (rational with denominator of 1) | |
lcm | lowest common multiple | none | 2 integers (rational with denominator of 1) | |
[ | in parameters, prepend a [ to use a stack value from bottom (0 is bottom) | it is the parameter | none | |
] | in parameters, prepend a ] to use a stack value from top (0 is top) | it is the parameter | none | |
Checks & Comparison | ||||
command | description | parameters required | arguments required | |
# | value stack height | none | none | |
step | x <= 0 → 0, 0 < x → 1 |
none | 1 rational | |
hyperStep | x = ∞ → 1, x = -∞ → -1, otherwise → 0 | none | 1 rational | |
compare | compares 2 rationals outputing -1, 0, or 1 | none | 2 rationals | |
query | checks a spot on the stack, if there's a rational, outputs 0, if it's a matrix, outputs 1 |
depth to check (0 is top) | none | |
Stack Manipulation | ||||
command | description | parameters required | arguments required | |
>> | copies value at depth | depth to copy (0 is top) | none | |
-> | moves value at depth to the top | depth to pull (0 is top) | none | |
<- | moves top value to depth (inverse of ->) (0 is top) | depth to push | none | |
del | deletes value at depth | depth to delete (0 is top) | none | |
Matrices | ||||
command | description | parameters required | arguments required | |
m | create matrix | columns, rows | (columns*rows) rationals | |
unzip | unzips matrix (inverse of m) | none | 1 Matrix | |
addRow | adds a scaled copy of one row to another | row from, row to (0 is first row) | 1 matrix and 1 rational (order doesn't matter) | |
scaleRow | scales a row of a matrix by a rational | row number (0 is first row) | 1 matrix and 1 rational (order doesn't matter) | |
swapRows | swaps 2 rows of a matrix | 2 rows to swap (0 is first row) | 1 matrix | |
T | transposes a matrix | none | 1 matrix | |
inv | inverses a matrix | none | 1 matrix | |
inverses a rational | none | 1 rational | ||
ref | does gaussian elimination | none | 1 matrix | |
ind | pushes index to stack | column, row (0 is first row/column) | 1 matrix (stays) | |
rip | rips the last column off a matrix | none | 1 matrix | |
flip | flips the columns of a matrix | none | 1 matrix | |
dim | dimensions of matrix | none | 1 matrix (stays) | |
dot | dot product of 2 vectors | none | 2 matrices (1 column, same size) | |
hadamard | hadamard product | none | 2 matrices (same size) | |
kronecker | kronecker product | none | 2 matrices | |
outer | outer product | none | 2 matrices (1 column) | |
Loops | ||||
command | description | parameters required | arguments required | |
jmp | jumps forwards or backwards in instructions | distance to jump | none | |
repeat | adds a new loop to the repeat pile | number of loops | none | |
next | does next iteration of top repeat | none | none | |
>>> | copy iteration of loop | loop depth to copy | none | |
break | breaks out of top loop | none | none | |
leap | a combination of break and jmp | distance to jump after break | none | |
Auxillary Manipulation | ||||
command | description | parameters required | arguments required | |
hold | remembers a rational or matrix for later, overriding any existing value | name of value | 1 rational or matrix (stays) | |
lose | forgets a stored value, does nothing if it doesn't exist | name to forget | none | |
place | copies stored value to stack | name of value to place | none | |
exists | place 1 or 0 if a value exists | name to check | none | |
$ | in parameters, prepend a $ to use an auxillary value | it is the parameter | none | |
IO & Strings | ||||
command | description | parameters required | arguments required | |
"..." | In parameters, place double quotes around some characters to make a string, you can use most UTF-8 characters, along with spaces, \n, \" and \\ | It is the parameter | none | |
inputS | Gives user a prompt for a string. Pushes the code points of the string in reverse order, then the length on top |
prompt (optional) | none | |
inputSE | same as inputS, but user can insert escape codes | prompt (optional) | none | |
inputR | Gives user a prompt for a rational, If it is invalid, it tries again Pushing the value |
prompt (optional) | none | |
chars | Like inputS, but the parameter is read instead of the user | string | none | |
outputC | Outputs a single character according to the parameter | code point | none | |
outputS | Outputs a message | message | none | |
outputV | outputs the top of the stack | none | 1 rational or matrix | |
error | outputs the parameter as an error, useful for custom commands! | message | none | |
Lambda Functions | ||||
command | description | parameters required | arguments required | |
run | interpret a matrix as a string, and executes it | none | 1 matrix (single row) | |
end | stops the current program, in a nice way. | none | none | |
halt | a classic halt and catch fire instruction. | none | none |