This repository was archived by the owner on Sep 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Functions
NieDżejkob edited this page Oct 30, 2017
·
16 revisions
Functions operate on data, which can either be an argument or the result of another function.
| Character | Function |
|---|---|
® |
Retrieve the value from the register |
³ |
First input (third command line argument) or 100
|
⁴ |
Second input (fourth command line argument) or 16
|
⁵ |
Third input (fifth command line argument) or 10
|
⁶ |
Fourth input (sixth command line argument) or " "
|
⁷ |
Fifth input (seventh command line argument) or "\n"
|
⁸ |
Sixth input (eighth command line argument) or []
|
⁹ |
Seventh input (ninth command line argument) or 256
|
⍺ |
Left Argument or 0.1
|
⍵ |
Right Argument or 1 (TODO) |
π |
Pi |
| Character | Function |
|---|---|
~ |
Bitwise NOT |
√ |
Square Root |
‘ |
Decrement |
’ |
Increment |
¹ |
Identity |
² |
Square |
! |
Factorial(z) if z is a nonnegative integer, -Factorial(abs(z)) if z is a negative integer, Gamma(z + 1) otherwise |
A |
Absolute Value |
B |
Convert integer to binary |
Ḅ |
Convert binary to integer |
D |
Convert integer to decimal |
Ḋ |
List Partitions |
Ḍ |
Convert decimal to integer |
E |
1 if all elements are equal, otherwise 0 |
Ė |
Enumerate; returns [[1, z[1]], [2, z[2]], ...]
|
F |
Flatten list completely |
G |
Format as a grid |
H |
Convert integer to hexadecimal |
Ḣ |
Pop and return the first value of a list |
Ḥ |
Convert hexadecimal to integer |
İ |
Inverse; 1 / z for integers and upside-down (wherever applicable) for characters |
J |
Range of length (range(len(z))) |
L |
Length |
Ḷ |
Lowered Range; 0 .. z - 1
|
Ṇ |
Logical NOT; does not vectorize |
P |
Product |
Ṗ |
Permutations |
R |
Range; 1 .. z
|
S |
Sum |
Ṣ |
Sort a list |
Ṡ |
Sign of a real number or conjugate of a complex number |
T |
Indices of truthy elements |
Ṫ |
Pop and return the last value of a list |
Ṭ |
Return an array of 1 and 0 with 1 at the indices of z |
U |
Return the unique elements of z in order by their first occurrence |
W |
Wrap; return [z] |
Ẇ |
Sublists; return all contiguous subslices of z |
X |
Random element of a list, random integer in the range 1 .. z if z is an integer, random float from 0 to z if z is a float |
Ẏ |
Tighten; flatten by 1 level |
Z |
Integer Partitions; all lists of positive integers that sum to z |
∆ |
Deltas; return differences of consecutive pairs |
↔ |
Reverse each sublist to the last level |
↕ |
Reverse a list; does not vectorize |
¬ |
Logical NOT; vectorizes |
↙ |
Transpose a matrix |
↘ |
Anti-transpose a matrix |
↶ |
Rotate a matrix by 90 degrees |
↷ |
Rotate a matrix by -90 degrees |
↻ |
Rotate a matrix by 180 degrees |
⁽ |
Prefixes |
⁾ |
Suffixes |