-
Notifications
You must be signed in to change notification settings - Fork 0
Tokens
okx-code edited this page Jul 10, 2017
·
74 revisions
Here's the list of tokens that manipulate items on the stack. Nilads take no values from the stack, monads take one, and dyads take two.
The general rule for the character chosen for a function:
- Nilad/general maths; standard alphabetical character
- Monad taking
int
; uppercase bold - Monad taking
list
; lowercase bold - Dyads; double struck
- Loops, conditionals etc; uppercase greek
- Variables; lowercase greek.
Special Cases:
- For certain characters, the
)
character is not required at the end if the end is the end of the file.
Additionally, if a token takes a list but instead an int is popped, the int will be exploded into a list and vice versa.
Token | Input | Function |
---|---|---|
ͻ .. ) |
Infinite loop. | |
₁ |
Get first input line | |
₂ |
Get second input line | |
₃ |
Get third input line | |
Γ .. ) |
any | Perform the operation(s) .. on each element in the list.Implicit exclusive range if integer. |
Δ .. ) |
any | If integer, create inclusive range or if list, add one to each value. Then perform the operation(s) .. on each element. |
Θ |
Push currently looped value or 100 if not in loop |
|
Λ .. ) |
list | Keep those in the list where <elem> .. is equal to 1
|
Ξ .. ) |
any | If int and equal to 1 , or if list and contains 1 , do ..
|
Π |
any | Assign the next variable to the top value in the stack |
Σ .. ) |
list | Keep those in the list where <elem> .. is equal to 0
|
Φ |
Push index in loop or 256 if not in loop |
|
Ψ |
list | Apply the next token to each element in the list |
& .. ) |
Create a list of the elements pushed in ..
|
|
÷ |
Terminate loop/conditional etc, if the top of the stack is truthy | |
# |
Else statement | |
$ |
Wrap stack to array | |
( .. ) |
Decompress a base 255 string | |
) |
Close loop/conditional etc. | |
.. - .. |
Assert that both sides evaluate to a truthy value | |
/ |
any | Delete from underneath: a, b -> b
|
: |
int | Previous prime |
; |
int | Next prime |
> |
int | Increment |
< |
int | Decrement |
_ |
list | Push each element to the stack |
B |
int | Compress a number into base 255 |
D |
any | Duplicate |
I |
Take one line of input | |
N .. ) |
int | N times do ..
|
Q |
Terminate program | |
R |
Randomly choose 1 or 0 | |
U |
any | Duplicate from underneath: a, b -> a, b, a
|
\ |
any | Delete |
^ |
stack | Delete all except top: a, b, c, d -> d
|
c |
Infinite list of perfect numbers (0-indexed) | |
f |
Infinite list of fibonacci numbers (well, up until 2^63-1 ) |
|
p |
int | Infinite list of polygonal numbers with side length a . |
t |
Shortcut for 3p
|
|
q |
Shortcut for 4p
|
|
𝐀 |
int | Absolute |
𝐁 |
int | Calculate all possible substrings |
𝐂 |
int | Get the characters |
𝐃 |
int | Get the largest divisor under a . |
𝐄 |
int | Check for palindromity |
𝐅 |
int | Get all factors |
𝐈 |
int | Inclusive range: (0 .. n] |
𝐋 |
int | Get the first n primes |
𝐌 |
int | Check for primality |
𝐍 |
int | Compute -a
|
𝐎 |
int | Logical NOT (in Neim, only 1 is truthy) |
𝐏 |
int | Prime factors |
𝐐 |
any | Check that all elements are equal |
𝐑 |
int | Exclusive range: [0 .. n) |
𝐒 |
int | Create a singleton list out of this |
𝐓 |
int | Factorial |
𝐔 |
int | Unique prime factors |
𝐕 |
int | Proper divisors. |
𝐗 |
int | Get all prefixes |
𝐜 |
int | Divisor count. |
𝐝 |
list | Get deltas (differences) between elements |
𝐠 |
list | Get greatest element |
𝐣 |
list | Join elements into an int
|
𝐥 |
list | Length |
𝐦 |
list | Get smallest element |
𝐧 |
any | Get the length, then create an inclusive range. |
𝐨 |
list | Sort |
𝐩 |
list | Product |
𝐫 |
any | Reverse |
𝐬 |
list | Sum |
𝐭 |
int | Check if composite |
𝐮 |
list | Uniquify |
𝐱 |
int | Get all suffixes |
𝔸 |
any, any | Append b to the end of a
|
𝔻 |
int, int | Add |
ℂ |
int, int | Check for coprimality |
𝔼 |
int, int | Check for equality |
𝔾 |
int, int | Is a > b ? |
𝕀 |
int, list | Index of a in b
|
𝕃 |
int, int | Is a < b ? |
𝕄 |
int, int | Modulo |
𝕆 |
int, int | Logical OR |
ℙ |
int, int | Get the a th polygonal number for a polygon with b sides. |
ℚ |
any, any | Check for equality, ignoring types |
ℝ |
int, int | Repeat a , b times |
𝕊 |
int, int | Subtract |
𝕋 |
int, int | Multiply |
𝕌 |
list, list | Only keep mutual elements [that are in both lists] |
𝕍 |
int, int | Integer division |
𝕎 |
int, int | Power |
𝕏 |
int, int | [first .. second) |
𝕒 |
int, int | Logical AND |
𝕓 |
any | Bifurcate; duplicate and reverse |
𝕔 |
list, int | Get closest value to int in list
|
𝕕 |
int, list | Get the a th element of b . |
𝕖 |
list, int | Get first b elements of a
|
𝕗 |
list, int | Get last b elements of a
|
𝕘 |
list, int | Remove the first b elements of a
|
𝕘 |
list | Remove the first element of a
|
𝕙 |
list, int | Remove the last b elements of a
|
𝕙 |
list | Remove the last element of a
|
𝕚 |
int, list | Check that the int is in the list
|
𝕞 |
int, int | Check that a is a multiple of b
|
𝕟 |
int, int | Concatenate |
𝕠 |
list, int | Count the amount of b in a . |
𝕣 |
int, int | Repeat b , a times |
𝕤 |
int, int | Subtract, then get absolute. |
ᚫ |
int | Multiply by 2 |
ᚺ |
int | Divide by 2 |
ᛄ |
int | Modulo 2 |
ᛖ |
int | Add 2 |
ᚠ |
int | Subtract 2 |
ᛟ |
int, list | End all current loops/conditionals etc, and run 𝕚 . |
ᛦ |
int | Square |
ᛃ |
int | Modulo 2, then perform logical NOT. |