Char | Name | Arg Types | Fixed Params | Input | Output | Docs |
---|---|---|---|---|---|---|
no_op | arg: [object] | custom | Does nothing | |||
! | not | a: [object] | 1! ""! 0! |
[0] [1] [1] |
if a: return 0 else: return 1 Non-truthy values: 0, 0.0, "", [], (), {}, set() |
|
" | string_literal | custom | " "World" "Hello |
[''] ['World'] ['Hello'] |
String literal. Ends with " | |
# | filter | seq: [list, tuple, str] *args |
eval_literal |
1 2 3 0]4# 1 2 3 4 5]5#Plt! 2 1 2 3 4 5]5#q |
[[1, 2, 3]] [[2, 3, 5]] [[2], 2] |
filter seq on Truthiness - returns the same type as given |
# | filter_infinite | inf: [InfiniteList] *args |
eval_literal |
None | ||
# | filter_values | dic: [dict] *args |
eval_literal |
for value, key in dic: rtn = literal_eval(value, key, args) if rtn: dic[key] = rtn else: del dic[key] |
||
# | up_to | up_to: [int, float] *args |
eval_literal |
10#} |
[[0, 2, 4, 6, 8, 10]] |
Repeat until return is bigger or equal to up_to |
$ | delta | seq: [list, tuple] | 1 2 3 5]4$ |
[[1, 1, 2]] |
Return the difference in terms in the input sequence. Returns a sequence of the same type, one shorter. |
|
$ | float | inp: [int, float] | float(inp) | |||
$ | get_day_of_week | time: [TypeTime] | None | |||
$ | is_lower | string: [str] | "HELLO"$ "world"$ \@$ |
[0] [1] [0] |
Is a string lower case? | |
% | every | seq: [list, tuple, str] b: [int] |
"testy"2% 1 2 3 4 5 6]6 3% |
['tsy'] [[1, 4]] |
seq[::b] | |
% | indexes | a: [object] seq: [list, tuple, str] |
\t "testy"% 1 1 01 2 1]5% |
[[0, 3]] [[0, 2, 4]] |
Return a list of indecies in seq that equal a | |
% | inf_every | inf: [InfiniteList] every: [int] |
None | |||
% | inf_not_every | every: [int] inf: [InfiniteList] |
None | |||
% | modulo | a: [int, float] b: [int, float] |
2 3% 6 5% |
[2] [1] |
a%b | |
& | and | a: [object] b: [object] |
2 1& 01& 4"Hello!"& |
[1] [False] ['Hello!'] |
a and b. Short circuiting. If not b, return a. | |
' | apply | *args | node_single node_single |
1 5'-h 5'th "hello"'th |
[2, 4] [6, 4] ['h', 'ello'] |
With the current stack, run the next 2 nodes with that stack. Pops `n` items from the stack where `n` is the greatest number of elements required. When a different number of args are taken by the nodes, the one that takes fewest consumes from closest to start of stack first towards the top of stack |
* | num_mult | a: [int, float] b: [int, float] |
4 5* |
[20] |
a*b | |
* | seq_mult | a: [list, tuple, str] b: [int, float] |
\a 2] 3* |
[['a', 2, 'a', 2, 'a', 2]] |
Repeat sequence a b times | |
* | seq_mult_2 | a: [int, float] b: [list, tuple, str] |
2 1 2 3]3* |
[[1, 2, 3, 1, 2, 3]] |
Repeat sequence b a times | |
* | time_mult | a: [TypeTime] b: [int, float] |
None | |||
+ | add | a: [object] b: [object] |
1 2+ |
[3] |
Adds two objects together - vanilla addition | |
+ | append_sequence | a: [list, tuple] b: [object] |
1 2 3]3 0+ |
[[1, 2, 3, 0]] |
Same as a.append(b). Works with tuples | |
+ | append_str | a: [str] b: [object] |
"test"1+ |
['test1'] |
Appends a non-sequence to a string | |
+ | join_sequence | a: [list, tuple] b: [list, tuple] |
1 2] 3 4]+ |
[[1, 2, 3, 4]] |
Add 2 sequences together. The returned type is the same as the first arg |
|
+ | prepend_sequence | a: [object] b: [list, tuple] |
4 1 2 3]3+ |
[[4, 1, 2, 3]] |
[a]+b. Works with tuples | |
+ | prepend_str | a: [object] b: [str] |
2"test"+ |
['2test'] |
Prepends a non-sequence to a string | |
+ | sort_join_inf_list | a: [InfiniteList] b: [InfiniteList] |
None | |||
, | is_numeric | string: [str] | "HELLO", "312", \@, |
[0] [1] [0] |
Is a string numeric? | |
, | sqrt | inp: [int, float] | 4, 9, |
[2] [3] |
Square root inp. Return an int if square number, float otherwise | |
, | transpose | inp: [list, tuple] | 1 2 3]3 4 5 6]3], |
[[[1, 4], [2, 5], [3, 6]]] |
zip(*inp) | |
- | r_pad | string: [str] amount: [int] |
pad string with spaces to make `amount` long | |||
- | sort_remove_inf_list | a: [InfiniteList] b: [InfiniteList] |
None | |||
- | sub_list | seq: [list, tuple] remove: [object] |
None | |||
- | sub_list_single | seq: [list, tuple] remove: [list, set] |
None | |||
- | sub_str | a: [str] b: [str] |
"test""te"- "test""ts"- |
['s'] ['e'] |
Remove all characters in b from a. | |
- | subtract | a: [object] b: [object] |
4 5- 42 7- |
[-1] [35] |
a-b. Vanilla subraction. | |
.# | sort_eval | *args | numeric_literal eval_literal |
1 5 2]3.# 1 2 3 4 5]5 10 2 8 4 6]5.#2R |
[[5, 2, 1]] [[2, 4, 5, 3, 1]] |
Sort input values by final outcome of loop |
.& | and_seq | seq: [list, tuple] | Setwise and of sequences | |||
.& | bit_and | a: [int] b: [int] |
4 5.& |
[4] |
a&b | |
., | transpose | inp: [list, tuple] | 1 2 3]3 4 5 6]3]., 1 2 3]3 4 5] 6]1]3., |
[[[1, 4], [2, 5], [3, 6]]] [[[1, 4, 6], [2, 5, 0], [3, 0, 0]]] |
Transpose with padding - contents is fill | |
.. | rickroll | Redirect to RickRoll | ||||
./ | count_bits | num: [int] base: [int] |
8 2./ 12 3./ |
[[1, 3]] [[0, 2, 1]] |
Count the number of times each digit occurs in `base` | |
.0 | splat_for | *args | numeric_literal eval_literal |
For loop. When finished, splat output |
||
.1 | forwards_splat_for | *args | numeric_literal eval_literal |
For loop. When finished, splat output forwards |
||
.: | translate | inp: [str] find: [list, tuple, str] replace: [list, tuple, str] |
Multiple find and replace | |||
.< | suffixes | a: [list, tuple, str] | "abcd".< 1 2 3 4]4.< |
[['d', 'cd', 'bcd', 'abcd']] [[[4], [3, 4], [2, 3, 4], [1, 2, 3, 4]]] |
Get all the possible suffixes of `a` | |
.> | prefixes | a: [list, tuple, str] | "abcd".> 1 2 3 4]4.> |
[['a', 'ab', 'abc', 'abcd']] [[[1], [1, 2], [1, 2, 3], [1, 2, 3, 4]]] |
Get all the possible prefixes of `a` | |
.C | chr | num: [int] | chr(int) | |||
.C | map_chr | lst: [list, tuple] | map(chr, list) | |||
.D | divmod | a: [int] b: [int] |
5 4.D 20 7.D |
[1, 1] [2, 6] |
Returns a//b and a%b. | |
.F | deep_for | *args | numeric_literal eval_literal |
0]1 1 2 3]4 4 5 6 7]4].Fh} 1 2 3 4]1 5]4 6] 7]3.FD 2%+ |
[[[[2], 4, 6, 8], [10, 12, 14, 16]]] [[2, [[2, 4, [4], 6], 6], 8]] |
Deeply run a for loop across a nD tree. Takes a list or tuple with a varying depth. Returns a list with the same depth all round with the function applied. |
.H | hcf | a: [int] b: [int] |
8 4.H 15 24.H |
[4] [3] |
Return the highest common factor of 2 numbers | |
.H | hcf_seq | a: [list, tuple] | 6]1.H |
[6] |
Return the highest common factor of n numbers | |
.I | if_kill | *args | eval_literal |
5 1.I} 5 0.I} |
[10] [] |
Takes stack. if arg1: stack = eval_literal(stack[:-1]) (extend mode) else: stack = [] |
.L | lcm | a: [int] b: [int] |
3 7.L 6 14.L |
[21] [42] |
Return the lowest common multiple of 2 numbers | |
.L | lcm_seq | a: [list, tuple] | 120]1.L |
[120] |
Return the lowest common multiple of n numbers | |
.R | get_runs | lst: [list, tuple, str] | 1 1 1 4 5 6 6 7 7 3]10.R "aaabbc".R |
[[[1, 1, 1], [4], [5], [6, 6], [7, 7], [3]]] [[['a', 'a', 'a'], ['b', 'b'], ['c']]] |
Group lst into runs of equal adjacent elements. | |
.X | print_grid | arg: [str] | string_literal |
Surround some text with characters: 0: upper (all), 1: tl (corners) 2: left 3: right 4: lower 5: tr 6: br 7: bl |
||
.X | space_pad | arg: [int] | string_literal |
Pad the character with `arg` spaces to the right | ||
.Y | dict | keys: [list, tuple, str] values: [list, tuple, str] |
"test""pi"] 2 3].Y "abc"1 2 3]3.Y |
[{'test': 2, 'pi': 3}] [{'c': 3, 'a': 1, 'b': 2}] |
Takes some keys and some values and turn them into a dictionary | |
.\ | space_pad | arg: [int] | string_single |
Pad the character with `arg` spaces to the left | ||
.^ | bit_xor | a: [int] b: [int] |
4 5.^ |
[1] |
a^b | |
.^ | startswith | string: [str] suffix: [str] |
"Test.""Te".^ "Test."\?.^ "Test."\T.^ |
[1] [0] [1] |
Does string start with suffix? | |
.^ | xor_seq | seqs: [list, tuple] | Setwise xor of sequences | |||
.a | abs_diff | a: [int, float] b: [int, float] |
1 2.a 5 2.a 1_2.a |
[1] [3] [3] |
Returns the absolute difference between 2 numbers | |
.b | nth_fib | n_th: [int] | 0.b 1.b 2.b 3.b 4.b |
[0] [1] [1] [2] [3] |
Returns the nth fibonacci number | |
.c | digit_sum | a: [int] | None | |||
.c | split | inp: [str] | "I went to the shop.".c "bob-bob is sad.".c "Why?".c "He, She, It.".c |
[['I', 'went', 'to', 'the', 'shop']] [['bob-bob', 'is', 'sad']] [['Why']] [['He', 'She', 'It']] |
Split by space and remove punctuation | |
.d | dictionary | int_list |
Lookup a list of english words in the built in dictionary. Use `/dictionary` for a compressor | |||
.f | first | eval_literal |
.f .f4> |
[1] [5] |
return first_n(1) | |
.f | first_n | count: [int] | eval_literal |
4.f 4.f4> |
[[1, 2, 3, 4]] [[5, 6, 7, 8]] |
return first_n_start(FirstN.contents) |
.f | first_n_start | count: [int] start: [int] |
eval_literal |
4 2.f 3 1_.ft |
[[2, 3, 4, 5]] [[-1, 0, 2]] |
Return first count items where the last element on the returned stack is true |
.o | lookup | word_id: [int] | None | |||
.o | ord | string: [str] | ord(string) | |||
.| | bit_or | a: [int] b: [int] |
4 1.| |
[5] |
a|b | |
.| | or_seq | seqs: [list, tuple] | Setwise or of sequences | |||
/ | count | a: [list, tuple, str] b: [object] |
"test"\t/ 3 1 2 1 3]5 3/ |
[2] [2] |
a.count(b) | |
/ | divide | a: [int, float] b: [int, float] |
4 2/ 2 4/ |
[2] [0.5] |
a/b. floating point division. For integer division, see `f` |
|
/ | split_length | inp: [list, tuple, str] lengths: [list, tuple] |
4 4 2 2 9 9]6 1 2 3]3/ |
[[[4], [4, 2], [2, 9, 9]]] |
Split inp into sections length lengths | |
/ | time_div | a: [TypeTime] b: [TypeTime] |
None | |||
/ | time_int_div | a: [TypeTime] b: [int, float] |
None | |||
/ | time_int_div_2 | a: [int, float] b: [TypeTime] |
None | |||
/ | transpose_inf_list | a: [InfiniteList] b: [InfiniteList] |
None | |||
: | insert | seq: [list, tuple, str] index: [int] obj: [object] |
"test"3_\a: "test"1_\y: "test"0"un": |
['teast'] ['testy'] ['untest'] |
Insert obj into seq at index. If obj is an int convert it to a float first |
|
: | multi_assign | seq: [list, tuple, str] indecies: [list, tuple] values: [list, tuple, str] |
"test"1 2] "pies": 1 2 3]3 02] "pies": |
['tiet'] [['p', 2, 'e']] |
for i in indecies: seq[i] = values[i] return seq |
|
: | multi_assign_generic | seq: [list, tuple, str] indecies: [list, tuple] obj: [object] |
0000]4 03] 1: |
[[1, 0, 0, 1]] |
for index in indecies: seq[index] = obj return seq |
|
: | range | start: [int, float] stop: [int, float] step: [int, float] |
1 6 2: 1.5 3.5 .5: |
[[1, 3, 5]] [[1.5, 2.0, 2.5, 3.0]] |
range(start,stop,step) | |
: | replace | a: [str] b: [str] c: [str] |
"test"\t \.: |
['.es.'] |
a.replace(b,c) | |
: | splice | a: [list, tuple, str] b: [int] c: [int] |
"test"1 3: "test"02_: "test"3 0: |
['es'] ['te'] ['tse'] |
a[b:c] or a[b:c:-1] | |
; | kill_stack | *args | numeric_literal |
4 2 4 5 1; 4 2;2 |
[] [] |
Remove the first `amount` items from the stack |
print_func_newline | arg: [object] | print arg return arg |
||||
< | indexable_1 | a: [list, tuple, str] b: [int] |
"test"2< |
['te'] |
a[:b] | |
< | indexable_2 | a: [int] b: [list, tuple, str] |
1"test"< |
['tes'] |
b[:-a] | |
< | inf_over_n | n: [int] inf: [InfiniteList] |
None | |||
< | inf_under_n | inf: [InfiniteList] n: [int] |
None | |||
< | less | a: [object] b: [object] |
4 2< 00< 4 5< |
[0] [0] [1] |
a | |
= | assign_var | x: [object] | node_class |
Takes a node as a fixed arg. Sets the contents of the node to x. This can also affect how the node behaves |
||
> | greater | a: [object] b: [object] |
4 2> 00> 4 5> |
[1] [0] [0] |
a>b | |
> | indexable_1 | a: [list, tuple, str] b: [int] |
"test"2> |
['st'] |
a[b:] | |
> | indexable_2 | a: [int] b: [list, tuple, str] |
3"test"> |
['est'] |
b[-a:] | |
> | inf_next_n | inf: [InfiniteList] n: [int] |
None | |||
> | inf_next_n_2 | n: [int] inf: [InfiniteList] |
None | |||
? | modify_var | *args | node_single node_class |
Takes 2 nodes as fixed args. Modifies the contents of node_B to node_A(inp, node_B.contents). This can also affect how the node behaves |
||
@ | at | a: [list, tuple, str] b: [int] |
"tes"1@ 1 2 3]3 1_@ |
['e'] [3] |
a[b] | |
@ | dict_at | a: [object] b: [dict] |
Literal Undefined |
['world'] |
return b[a] | |
@ | get_distance_to_earth | time: [TypeTime] object: [str] |
Gets the distance to the Earth from `object` | |||
@ | index | a: [object] b: [list, tuple, str] |
1 1 2 3]3@ 3 1 2 3]3@ 4 1 2 3]3@ \e "hello"@ \? "hello"@ |
[0] [2] [-1] [1] [-1] |
b.index(a) | |
@ | inf_at | inf: [InfiniteList] nth: [int] |
None | |||
@ | inf_at_2 | nth: [int] inf: [InfiniteList] |
None | |||
@ | set_bit | a: [int] b: [int] |
2 0@ 1 2@ |
[3] [5] |
Set bit b in a | |
A | deep_apply | seq: [list, tuple] | node_single |
00] 01]] 1 0] 1 1]]]A+ |
[[[0, 1], [1, 2]]] |
Deeply apply a node to a nD tree |
A | splat_args | *args | node_single |
30A" 3 4AD |
['30'] [3, 3, 3, 3] |
Splat a node with a static suffix and run it |
B | get_next_full_moon | time: [TypeTime] | Gets the date of the next full moon | |||
B | is_alpha | string: [str] | "HELLO"B "World7"B \@B |
[1] [0] [0] |
Is a string alphabetic? | |
B | product | inp: [list, tuple] | 1 2]B 3 4]B 3 4 2]3B |
[2] [12] [24] |
return product of integer sequence | |
B | to_int | inp: [int, float] | Return int(inp) | |||
C | clock | numeric_literal |
C075 |
[1, 2019, 10] |
Default - time.time() 0 - weekday - 0 based. Monday is 0, Sunday is 6. 1 - isocalendar 2 - seconds 3 - minutes 4 - hours 5 - days 6 - months 7 - year (full) 8 - year (tens and units) 9 - Months of the year (1 indexed, 0 is "PADDING") Default contents: days of the week |
|
D | dup | a: [object] | numeric_literal |
"test"D 1D3 |
['test', 'test'] [1, 1, 1] |
Duplicate the top of the stack `amount` times (default 2) |
E | eval | *args | "}+"1 5E \] 1 5E |
[7] [[5, 1]] |
Takes entire stack. Evals first item as Pyke code. Returns resulting stack onto the stack |
|
F | for_loop | *args | base10_single eval_literal |
1 5]F} 1 5] 2F2}+ 3 2F2* "tesT"F$` |
[[2, 10]] [[4, 12]] [[0, 2, 4]] ['1110'] |
Constant arg - how many items off the stack to take, default 1 arg1 - object to iterate over (if int, range(arg1)) Returns a list of lists to the stack |
F | map | inf: [InfiniteList] | base10_single eval_literal |
None | ||
F | map_times | repeats: [int] time: [TypeTime] |
base10_single eval_literal |
None | ||
F | next_time | time: [TypeTime] | base10_single eval_literal |
None | ||
G | alphabet | None | ||||
H | get_next_new_moon | time: [TypeTime] | Gets the date of the next new moon | |||
H | randint | inp: [int] | Random number between 0 and inp inclusive | |||
H | random_choice | inp: [list, tuple, str] | Choose one in a list randomly | |||
I | if | *args | eval_literal |
5 1I} 5 0I} |
[10] [5] |
Takes stack. if arg1: stack = eval_literal(stack[:-1]) (extend mode) else: stack = stack[:-1] |
I | not_filter_infinite | inf: [InfiniteList] | eval_literal |
None | ||
J | join | *args | 1 5J 1 5]J 1 5] \ J "Hello""World!"", "J 1 2 3 4\.J |
['1\n5'] ['1\n5'] ['1 5'] ['Hello, World!'] ['1.2.3.4'] |
If arg1 is a list or tuple, args = arg1 Else: args = stack. return `fixed_arg`.join(args) |
|
K | kill_one | _: [object] | Kill the first item on the stack | |||
L | dict_map | dic: [dict] *args |
node_single |
Literal Undefined |
[{1: 4, 2: 4, 3: 5}] |
Map the values in the dictionary to node(value, key, *args) |
L | int_map | num: [int] *args |
node_single |
5 2L+ |
[[2, 3, 4, 5, 6]] |
seq_map(range(num), args) |
L | seq_map | seq: [list, tuple] *args |
node_single |
10 12 23 44]4 10L% |
[[0, 2, 3, 4]] |
Map with the seq arg going on the stack last |
L | str_map | s: [str] *args |
node_single |
"seed"\ L+ |
['s e e d '] |
seq_map(list(s), args) |
M | apply_inf_list | a: [InfiniteList] b: [InfiniteList] |
node_single |
None | ||
M | deep_map | *args | node_single |
01 2 3]4 4 5 6 7]4]M} |
[[[0, 2, 4, 6], [8, 10, 12, 14]]] |
Deeply map an operation across a nD tree. Takes a list or tuple with a varying depth. Returns a list with the same depth all round with the function applied. |
N | notequals | a: [object] b: [object] |
1 2N 1.0 1N "test""test"N |
[1] [0] [0] |
a!=b. Returns an int | |
O | add_two | inp: [int, float] | 2O |
[4] |
inp+2 | |
O | rm_end | inp: [list, tuple, str] | 1 2 3]3O |
[[1, 2]] |
inp[:-1] | |
P | get_moon_phase | time: [TypeTime] | Gets the current phase of the moon | |||
P | is_int | num: [float] | None | |||
P | is_vowel | string: [str] | "HELLO"P "World7"P \@P "aea"P |
[0] [0] [0] [1] |
Is a string all vowels? | |
P | prime | a: [int] | 5_P 1_P 8_P 18P |
[1] [0] [0] [[2, 3, 3]] |
If is_neg(a): return is_prime(a) Else: return prime_factors(a) |
|
P | print_grid | seq: [list, tuple] | Print a 2D grid with padding equal to the maximum length Or print a 1D list with padding equal to the maximum length |
|||
P | sort_values | dic: [dict] | Literal Undefined |
[[1, '2']] |
Return the keys of the dictionary in a list sorted by their values | |
Q | eval_input | Prompt for content at start. Returns by default. | ||||
R | rot_x | *args | numeric_literal |
1 0R 1 2 3 4R4 |
[1, 0] [1, 2, 3, 4] |
Rotate the top `amount` items on the stack by 1. |
S | one_range | a: [int] | 3S |
[[1, 2, 3]] |
range(1,a) | |
S | sort | a: [list, tuple, str] | 2 3 4 1]4S "test"S |
[[1, 2, 3, 4]] ['estt'] |
sorted(a) - returns the same type as given | |
T | ten | None | ||||
U | is_upper | string: [str] | "HELLO"U "World"U |
[1] [0] |
Is a string all upper case? | |
U | nd_range | seq: [list, tuple] | 2 2]U |
[[[[0, 0], [0, 1]], [[1, 0], [1, 1]]]] |
Return a n dimensional range where n = len(seq). Each dimension's length is equal to the current item in the seq. Each item in the returned list is a list with it's coords. |
|
U | range | num: [int] | 4U |
[[0, 1, 2, 3]] |
range(num) | |
V | repeat | *args | eval_literal |
2 3VX 5V1 |
[256] [1, 1, 1, 1, 1] |
For i in range(repeats): stack = eval_literal(stack) return stack |
W | while | *args | eval_literal |
0WhD 5N |
[5] |
Takes stack, returns stack. while not continue: stack = run_ast(stack) continue = pop(stack) return stack |
X | splat | a: [list, tuple, str] | 2 3 4 1]4X "hello"X |
[2, 3, 4, 1] ['h', 'e', 'l', 'l', 'o'] |
return a (extend mode) | |
X | square | x: [int, float] | 3X |
[9] |
Return X squared | |
Y | dict | a: [list, tuple] | "test"2] 2 3]]Y |
[{'test': 2, 2: 3}] |
Turn a sequence into a dict. If that fails, take the mean | |
Y | digits | num: [int] | None | |||
Y | get_day_of_year | time: [TypeTime] | None | |||
Z | zero | Add contents (default 0) to the stack | ||||
[ | function | *args | custom | Define a macro the first time called - First time takes an AST - After that takes nothing - Calls the AST with the contents of the stack |
||
\ | string_single | custom | \! |
['!'] |
Add a single char onto the stack | |
] | create_list | *args | numeric_literal |
5 6 1 2]4 "Hello""World"] |
[[5, 6, 1, 2]] [['Hello', 'World']] |
Take the top `amount` items from the stack and turn them into a list. Defaults to the whole stack |
^ | closest_to | lst: [list, tuple] value: [int, float] |
1 2 6 7]4 5^ 1_01]3 0^ 1_1] 0^ |
[6] [0] [-1] |
Given a list of numbers, return the closest one to `value`. If 2 numbers are of the same distance, the one closest to the start of the original list is returned |
|
^ | endswith | string: [str] suffix: [str] |
"Test."\.^ "Test."\?^ "Test.""t."^ |
[1] [0] [1] |
Does string end with suffix? | |
^ | get_distance_to_sun | time: [TypeTime] object: [str] |
Gets the distance to the sun from `object` at `time` | |||
^ | lpad | string: [str] amount: [int] |
"abc"5^ "abc"2^ "te "6^ |
['abc '] ['abc'] ['te '] |
Return string padded with spaces to make it `amount` in length | |
^ | mixed_base | inp: [list, tuple] bases: [list, tuple] |
1 2 3 4 5]5 10 10 4 62 7]5^ 4 2] 5 10]^ 3 07]3 5 1 10]3^ |
[22167] [42] [37] |
Convert from a mixed base number to an integer | |
^ | pow | a: [int, float] b: [int, float] |
3 2^ 2 2_^ |
[9] [0.25] |
a**b | |
_ | negate | a: [int, float] | 7_ |
[-7] |
-a | |
_ | reverse | sequence: [list, tuple, str] | 3 2]_ |
[[2, 3]] |
sequence[::-1] | |
` | str | a: [object] | 3 2]` 17` 4.2` "Hi"` |
['[3, 2]'] ['17'] ['4.2'] ['Hi'] |
str(a) | |
a | apply_values | dic: [dict] *args |
eval_literal |
for value, key in dic: dic[key] = eval_literal(value) |
||
a | deep_for_apply | seq: [list, tuple] | eval_literal |
00] 01]] 1 0] 1 1]]]a+h |
[[[1, 2], [2, 3]]] |
Deeply apply a node to a nD tree |
a | inf_list | base: [int, float, str] | eval_literal |
None | ||
b | int_str | a: [int] | numeric_literal |
5b2 |
['101'] |
Return a in base `base` Base contents can be changed by changing the contents |
b | round | a: [float] | numeric_literal |
10.1b0 9.5b0 913.567b2 913.567b02 |
[10] [10] [913.57] [900] |
round(a, `base`) |
b | seq_int | a: [list, tuple] | numeric_literal |
2 1 0]3b2 |
[10] |
Return a in base `base` |
b | str_int | a: [str] | numeric_literal |
" 101 "b "101"b2 |
[101] [5] |
Return a in base `base` as an integer Base contents can be changed by changing the contents |
c | center | length: [int] string: [str] |
3\Ic 5"It"c |
[' I '] [' It '] |
Center a `string` to `length` | |
c | chunk | inp: [list, tuple, str] size: [int, float] |
"134"1c "1234"2c |
[['1', '3', '4']] [['12', '34']] |
Return inp seperated into groups sized size | |
c | count | seq: [list, tuple] | 1 2 2 3 3 3]6c |
[{1: 1, 2: 2, 3: 3}] |
Return a dict with values equal to the number of times values appear in a list | |
c | floor_remainder | a: [int, float] multiple: [int, float] |
3 1c 3 2c 7 3c |
[3] [2] [6] |
a-(a%multiple) | |
c | format_time | time_obj: [TypeTime] string: [str] |
None | |||
c | split | inp: [str] split: [str] |
"1 2 1"\ c "1,3,4"\,c |
[['1', '2', '1']] [['1', '3', '4']] |
inp.split(`arg`) | |
c | split_space | inp: [str] | return inp.split(" ") | |||
d | space | None | ||||
e | end | inp: [list, tuple, str] | "Hello"e 1 2 3]3e |
['o'] [3] |
inp[-1] | |
e | floor_half | inp: [int, float] | 12e 11e |
[6] [5] |
inp//2 | |
e | is_weekend | time: [TypeTime] | None | |||
e | values | inp: [dict] | Literal Undefined |
[[1, 2]] |
sorted(inp.values) | |
f | chunk | inp: [list, tuple, str] num: [int] |
"134"1f "1234"2f "1234"3f 4 8 15 16 23 42]6 5f "123456789"5f 4 8 15 16 23 42]6 7f |
[['134']] [['12', '34']] [['1', '2', '34']] [[[4], [8], [15], [16], [23, 42]]] [['1', '2', '3', '4', '56789']] [[[], [], [], [], [], [], [4, 8, 15, 16, 23, 42]]] |
Return inp seperated into num groups | |
f | combinations | length: [int] seq: [list, tuple, str] |
Return all combinations of `seq` length `length` | |||
f | floor_divide | a: [int, float] b: [int, float] |
3 2f 6 3_f |
[1] [-2] |
a/b. Rounds down, returns an int. | |
f | get_size | time: [TypeTime] object: [str] |
Gets the size of the object in arcseconds | |||
f | split_at | inp: [list, tuple, str] splits: [list, tuple] |
4 4 2 2 9 9]6 02_07 0]5f |
[[[4], [4, 2], [2, 9, 9]]] |
Split inp at truthy values in splits | |
f | time_div | a: [TypeTime] b: [TypeTime] |
None | |||
f | time_int_div | a: [TypeTime] b: [int, float] |
None | |||
f | time_int_div_2 | a: [int, float] b: [TypeTime] |
None | |||
generic_variable | None | |||||
h | date | time: [TypeTime] | return date part of time | |||
h | first | inp: [list, tuple, str] | 3 2]h "test"h |
[3] ['t'] |
inp[0] | |
h | increment | inp: [int, float] | 3h |
[4] |
inp+1 | |
h | inf_next | inf: [InfiniteList] | None | |||
h | keys | inp: [dict] | Literal Undefined |
[[1, '2']] |
sorted(inp.keys) | |
i | i | custom | If has contents, return contents. Otherwise set contents to stack[0] and return |
|||
j | j | custom | If has contents, return contents. Otherwise set contents to stack[0] and return |
|||
k | empty_string | None | ||||
l | dec_time | time: [TypeTime] | base10_single |
Decrement a time object by the following amount: 0 - years 1 - months 2 - days 3 - hours 4 - minutes 5 - seconds 6 - weeks 7 - 4 years 8 - decades 9 - 12 hours |
||
l | factors | num: [int] | base10_single |
None | ||
l | letters | x: [list, tuple, str, dict] | base10_single |
3 2]l0 "Hi!"l1 "Hi!"l2 "Hi!"l3 "hello world"l4 "hello world"l5 "hello world"l6 " world "l7 " world "l8 " world "l9 |
[2] ['hi!'] ['HI!'] ['hI!'] ['Hello World'] ['Hello world'] ['Hello World'] ['world'] ['world '] [' world'] |
0 - len (floor(log(x)) with numbers) 1 - lower 2 - upper 3 - swapcase 4 - title 5 - capitalize 6 - capwords 7 - strip 8 - lstrip 9 - rstrip |
l | nth_root | num: [float] | base10_single |
None | ||
m | dict_map | dic: [dict] *args |
node_single |
Literal Undefined |
[{1: 4, 2: 4, 3: 5}] |
None |
m | infinity_map | inf: [InfiniteList] *args |
node_single |
None | ||
m | infinity_map_2 | inf_1: [InfiniteList] inf_2: [InfiniteList] |
node_single |
None | ||
m | infinity_map_3 | arg: [object] inf: [InfiniteList] |
node_single |
None | ||
m | int_map | num: [int] *args |
node_single |
5 2m+ |
[[2, 3, 4, 5, 6]] |
None |
m | seq_map | seq: [list, tuple] *args |
node_single |
4_2 3 4]4 5m+ 1 2 3 4]4 2m^ 1 0"""hi"]4m! |
[[1, 7, 8, 9]] [[2, 4, 8, 16]] [[0, 1, 1, 0]] |
None |
m | str_map | s: [str] *args |
node_single |
"seed"\ m+ |
[' s e e d'] |
None |
n | newline | None | ||||
numeric_literal | custom | 1 1.5 .1 |
[1] [1.5] [0.1] |
Returns a numeric literal, including floats. Values can't end with a ".", instead use ".0" The "0" digit gets returned immediately if it is at the beginning. |
||
o | iterator | contents += 1 return contents-1 |
||||
p | print_func | arg: [object] | print arg return arg |
|||
q | equals | a: [object] b: [object] |
1 2q 1.0 1q "test""test"q |
[0] [1] [1] |
a==b. Returns an int | |
r | func_return | If in a function, return the current stack | ||||
r | goto_start | Goto the start of the program, keeping the same stack | ||||
s | inc_time | time: [TypeTime] | base10_single |
Increment a time object by the following amount: 0 - years 1 - months 2 - days 3 - hours 4 - minutes 5 - seconds 6 - weeks 7 - 4 years 8 - decades 9 - 12 hours |
||
s | palendromise | inp: [str] | base10_single |
None | ||
s | periodic_lookup | id: [int] | base10_single |
0 - period 1 - symbol 2 - name 3 - shells 4 - phase 5 - melt 6 - boil 7 - atomic_mass 8 - density 9 - discovered_by |
||
s | prime | inp: [int] | base10_single |
None | ||
s | run_infinite | inf: [InfiniteList] | base10_single |
None | ||
s | sum_stack | *args | base10_single |
1 2s 3 4]s \t \e \s \ts0 |
[3] [7] ['test'] |
If no `amount`: return sum(stack) Else if arg1 is a list, return sum(arg1) Else return sum(stack[:`amount`]) |
t | decrement | inp: [int, float] | 2t |
[1] |
inp-1 | |
t | first | inp: [list, tuple, str] | 1 2 3]3t |
[[2, 3]] |
inp[1:] | |
t | inf_tail | inf: [InfiniteList] | None | |||
t | items | inp: [dict] | Literal Undefined |
[[[1, 1], ['2', 2]]] |
sorted(inp.items) | |
t | time | time: [TypeTime] | Literal Undefined |
[00:00:00] |
None | |
u | int_list | custom | u!J` |
[[33, 74, 96]] |
length = ord(`arg`[0]) return [ord(a) for a in `arg`[1:length+1]] |
|
w | base96_single | custom | w w! w |
[0] [1] [-32] |
Return ord(const_arg)-32 | |
y | time_literal | string_literal |
None | |||
z | input | input() or Input.contents | ||||
{ | in | a: [object] b: [list, tuple, str] |
6 6 2 1]3{ 3 6 2 1]3{ |
[1] [0] |
a in b. returns an int | |
{ | mold | inp: [list, tuple, str] length: [int] |
Reshape `inp` so it is `length` long, cylicly | |||
{ | str_in | a: [int] b: [str] |
3"123"{ |
[1] |
str(a) in b | |
{ | unset_bit | a: [int] b: [int] |
1 1{ 3 1{ 5 2{ 7 0{ |
[1] [1] [1] [6] |
Unset bit b in a | |
| | or | a: [object] b: [object] |
2 1| 3 0| 01| """"| |
[2] [3] [1] [0] |
a or b. Short circuiting. if a: return a if b: return b return 0 |
|
} | deduplicate | seq: [list, tuple, str] | 1 2 3 1 1]5} "hi!!!"} |
[[1, 2, 3]] ['hi!'] |
remove duplicates from seq | |
} | double | inp: [int, float] | 2} 1.5} |
[4] [3] |
inp*2 | |
~ | get_var | node_class |
~M ~{ ~Y ~W ~ ~m ~' ~c ~a ~V ~l ~G ~B ~k ~! ~J ~p ~Z ~[ ~- ~o ~.L ~u ~.H ~., ~K ~T ~N ~b ~n ~s ~I ~$ ~.Y ~_ ~d ~f ~P ~./ ~t ~L ~z ~: ~U ~.R ~% ~F ~C ~] ~.f ~e |
[[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]] [802] [256] [1] [' '] [1000] [100] ['bcdfghjklmnpqrstvwxz'] ['\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0¡¢£¤¥¦§¨©ª«¬\xad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'] ['aeiou'] ['abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'] ['abcdefghijklmnopqrstuvwxyz'] ['><+-.,[]'] [''] [333332] ['0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'] [<CountList><filter('_P')>] [0] [[]] ['bcdfghjklmnpqrstvwxyz'] [0] [()] ['0123456789'] [{}] [0] ['0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c'] [10] [<CountList><modify('_')>] ['0123456789abcdefghijklmnopqrstuvwxyz'] ['\n'] [{'Zn': 'Zinc', 'Ce': 'Cerium', 'Bk': 'Berkelium', 'Pb': 'Lead', 'Be': 'Beryllium', 'Nb': 'Niobium', 'Ag': 'Silver', 'Ca': 'Calcium', 'In': 'Indium', 'Xe': 'Xenon', 'Am': 'Americium', 'Tb': 'Terbium', 'Cd': 'Cadmium', 'Br': 'Bromine', 'Sm': 'Samarium', 'Pu': 'Plutonium', 'H': 'Hydrogen', 'Fl': 'Flerovium', 'Nh': 'Nihonium', 'Al': 'Aluminium', 'At': 'Astatine', 'Ds': 'Darmstadtium', 'Yb': 'Ytterbium', 'Ta': 'Tantalum', 'Mg': 'Magnesium', 'Fe': 'Iron', 'Ir': 'Iridium', 'Rb': 'Rubidium', 'O': 'Oxygen', 'C': 'Carbon', 'Te': 'Tellurium', 'Mc': 'Moscovium', 'Cl': 'Chlorine', 'Ne': 'Neon', 'Tl': 'Thallium', 'Md': 'Mendelevium', 'Lu': 'Lutetium', 'Cs': 'Cesium', 'Ge': 'Germanium', 'Mo': 'Molybdenum', 'Ga': 'Gallium', 'Cr': 'Chromium', 'W': 'Tungsten', 'B': 'Boron', 'Pr': 'Praseodymium', 'K': 'Potassium', 'I': 'Iodine', 'Er': 'Erbium', 'Po': 'Polonium', 'Ra': 'Radium', 'Y': 'Yttrium', 'N': 'Nitrogen', 'Cn': 'Copernicium', 'Rh': 'Rhodium', 'Ts': 'Tennessine', 'No': 'Nobelium', 'Tm': 'Thulium', 'Ho': 'Holmium', 'Sn': 'Tin', 'Ti': 'Titanium', 'Dy': 'Dysprosium', 'Ru': 'Ruthenium', 'Na': 'Sodium', 'S': 'Sulfur', 'Db': 'Dubnium', 'P': 'Phosphorus', 'Sr': 'Strontium', 'Hf': 'Hafnium', 'Nd': 'Neodymium', 'Lr': 'Lawrencium', 'Th': 'Thorium', 'Re': 'Rhenium', 'Cf': 'Californium', 'Es': 'Einsteinium', 'Au': 'Gold', 'Kr': 'Krypton', 'U': 'Uranium', 'Hs': 'Hassium', 'Hg': 'Mercury', 'Sb': 'Antimony', 'Eu': 'Europium', 'Pa': 'Protactinium', 'Se': 'Selenium', 'Np': 'Neptunium', 'Zr': 'Zirconium', 'Sc': 'Scandium', 'V': 'Vanadium', 'Pd': 'Palladium', 'Rf': 'Rutherfordium', 'Ac': 'Actinium', 'Rg': 'Roentgenium', 'Si': 'Silicon', 'Fm': 'Fermium', 'Cu': 'Copper', 'Bi': 'Bismuth', 'Co': 'Cobalt', 'Fr': 'Francium', 'Li': 'Lithium', 'Ar': 'Argon', 'Os': 'Osmium', 'La': 'Lanthanum', 'As': 'Arsenic', 'F': 'Fluorine', 'Tc': 'Technetium', 'Bh': 'Bohrium', 'Mn': 'Manganese', 'Sg': 'Seaborgium', 'Og': 'Oganesson', 'Mt': 'Meitnerium', 'Pt': 'Platinum', 'Pm': 'Promethium', 'Gd': 'Gadolinium', 'He': 'Helium', 'Ni': 'Nickel', 'Rn': 'Radon', 'Cm': 'Curium', 'Ba': 'Barium', 'Lv': 'Livermorium'}] [<CountList><modify('h2.DR}t*')>] [['PADDING', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']] ['qwertyuiopasdfghjklzxcvbnm'] [333333] [' '] [<DummyList>] [3.141592653589793] [2000] [['seconds', 'minutes', 'hours', 'days', 'weeks', 'months', 'years', 'decades', 'centuries', 'millenia']] [-1] [''] ['+-*/'] [['second', 'minute', 'hour', 'day', 'week', 'month', 'year', 'decade', 'century', 'millennium']] ['https://api.stackexchange.com/2.2/'] [['Padding', 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]] [<CountList><modify('.b')>] [['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']] [[]] [1] [2.718281828459045] |
return the contents of `node` |