owned this note
owned this note
Published
Linked with GitHub
# 05AB1E - Rewrite
## NOTE
- [ ] Check for documentation of new commands/functions
### Full commands list
- [x] ǝ = pop a,b,c insert b into a on location c
- [x] ʒ = pop a filter a when the result of code == 1: usage ʒCODE}
- [x] α = pop a,b push absolute difference of a and b
- [x] β = pop a,b push a converted from base b (arbitrary)
- [x] γ = pop a push a split into chunks of consecutive equal elements
- [x] δ = pop a,b get the next command, push double vectorized command
- [x] ε = pop a apply each on a: usage εCODE}
- [x] ζ = pop a,(b) push zipped a with filler b (standardized to space)
- [x] η = pop a push prefixes(a)
- [x] θ = pop a push a[-1]
- [x] в = pop a,b push a converted to base b (arbitrary)
- [x] и = pop a,b push a n-repeat (list-multiply) b
- [x] м = pop a,b push a.remove(all elements of b)
- [x] н = pop a push a[0]
- [x] т = push 100
- [x] Γ =
- [x] Δ = pop a repeat CODE until a doesn't change: usage ΔCODE}
- [x] Θ = pop a push 05AB1E truthified a (a == 1)
- [x] ι = pop (a),b push [a[0::b], a[1::b], ..., a[b - 1::b]]
- [x] Σ = pop a sort a by the result of code: usage ΣCODE}
- [x] Ω = pop a push random_pick(a)
- [x] ≠ = pop a push 05AB1E falsified a (a != 1)
- [x] ∊ = pop a push vertically mirrored a
- [x] ∍ = pop a,b push a extended/shortened to length b
- [x] ∞ = <s>pop a push mirrored a</s> → push infinite list ([1, 2, ..., ∞])
- [x] ₁ = push 256, or in recursive environment, push a(n - 1)
- [x] ₂ = push 26, or in recursive environment, push a(n - 2)
- [x] ₃ = push 95, or in recursive environment, push a(n - 3)
- [x] ₄ = push 1000, or in recursive environment, push a(n - 4)
- [x] ₅ = push 255, or in recursive environment, pop x and push a(x)
- [x] ₆ = push 36, or in recursive environment, pop x and push a(n - x)
- [x]
- [x] ! = pop a, push factorial(a)
- [x] " = start/end string literal
- [x] # = pop a if true: break/end (used in infinite loops)
- [x] # = pop a if contains spaces, split on spaces
- [x] $ = push 1 and input (used for sequences)
- [x] % = pop a,b push (a % b)
- [x] & = pop a,b push a AND b
- [x] ' = push char ( 'a pushes "a" )
- [x] ( = pop a push -a
- [x] ) = wrap total stack to an array
- [x] * = pop a,b push (a * b)
- [x] + = pop a,b push (a + b)
- [x] , = pop a print(a)
- [x] - = pop a,b push (a - b)
- [x] . = two char functions
- [x] / = pop a,b push (a / b)
- [x] 0 = numeric literal
- [x] 1 = numeric literal
- [x] 2 = numeric literal
- [x] 3 = numeric literal
- [x] 4 = numeric literal
- [x] 5 = numeric literal
- [x] 6 = numeric literal
- [x] 7 = numeric literal
- [x] 8 = numeric literal
- [x] 9 = numeric literal
- [x] : = pop a,b,c a.replace(b, c) / infinite replacement
- [x] ; = pop a push a / 2
- [x] < = pop a push a - 1
- [x] = = print last item
- [x] > = pop a push a + 1
- [x] ? = pop a print a no newline
- [x] @ = <s>pop a pop and push the element at index a in the stack</s> pop a,b push a >= b
- [x] A = push 'abcdefghijklmnopqrstuvwxyz'
- [x] B = pop a,b push base(a, b)
- [x] C = pop a push int(a, 2)
- [x] D = pop a push a, a
- [x] E = <s> push eval(input())</s> → pop a for N in range(0, a + 1). Usage E<func>}
- [x] F = pop a for N in range(0, a) { }: F(commands)} / N = variable
- [x] G = pop a for N in range(1, a) { }: F(commands)} / N = variable
- [x] H = pop a push int(a, 16)
- [x] I = push input()
- [x] J = pop a push ''.join(a) if a is list / if not, then push ''.join(stack)
- [x] K = pop a,b push a with no b's
- [x] L = pop a push [1 .. a]
- [x] M = push the largest number in the stack
- [x] N = reserved for variables
- [x] O = pop (a) push total sum of a if a is list, else total sum of stack
- [x] P = pop (a) push total product of a if a is list, else total product of stack
- [x] Q = pop a,b push a == b (bool)
- [x] R = pop a push reversed(a)
- [x] S = pop a push all chars a seperate
- [x] T = push 10
- [x] U = pop a assign X to a
- [x] V = pop a assign Y to a
- [x] W = push min(a) without popping
- [x] X = integer variable
- [x] Y = integer variable
- [x] Z = push max(a) without popping
- [x] [ = infinite loop start
- [x] \ = delete last item
- [x] ] = close all loops and if statements
- [x] ^ = pop a,b push a XOR b
- [x] _ = pop a push negative bool
- [x] ` = pop a push all the items of a into the stack
- [x] a = pop a push is_alpha(a)
- [x] b = pop a push bin(a)
- [x] c = pop a,b push a nCr b
- [x] d = pop a push is_number(a)
- [x] e = pop a,b push a nPr b
- [x] f = pop a push list of prime factors (no duplicates)
- [x] g = pop a push length of a
- [x] h = pop a push hex(a)
- [x] i = pop a if statement: iTHEN}: if true { then }
- [x] j = pop a Same as J, with each substring right justified w/ a length of b
- [x] k = pop a,b push 0-indexed index of b in a (-1 when not found)
- [x] l = pop a push lower_case(a)
- [x] m = pop a,b push a**b
- [x] n = pop a push a**2
- [x] o = pop a push 2**a
- [x] p = pop a push isPrime(a)
- [x] q = terminates the program
- [x] r = reverse stack
- [x] s = pop a,b push b,a
- [x] t = pop a push sqrt(a)
- [x] u = pop a push upper_case(a)
- [x] v = pop a range loop: for y in a (y = string, N = index)
- [x] w = wait one second
- [x] x = pop a push a, a * 2
- [x] y = push string variable (used in mapping loops)
- [x] z = pop a push 1 / a
- [x] { = pop a push sorted a
- [x] | = push the rest of input as an array with strings
- [x] } = close a single if statement, loop, etc.
- [x] ~ = pop a,b push a OR b
- [x] Ƶ = convert the next char from base 255 to base 10 and add 101
- [x] € 0 = pop a apply next command for each in a
- [x] Λ = pop a,b,c store a canvas with {a: num, b: filler, c: pattern} (todo: docs)
- [x] ‚ 1 = pop a,b push [a, b]
- [x] ƒ 2 = pop a push for N in range(0, a + 1)
- [x] „ 3 = 2 char string / can also be used for 2 compressed strings
- [x] … 4 = 3 char string / can also be used for 3 compressed strings
- [x] † 5 = pop a,b push a with b filtered to the front
- [x] ‡ 6 = pop a,b,c push a.transliterate(b -> c)
- [x] ˆ 7 = pop a add to global array
- [x] ‰ 8 = pop a,b push a divmod b
- [x] Š 9 = pop a,b,c push c,a,b
- [x] ‹ 10 = pop a,b push a < b
- [x] Œ 11 = pop a push substrings(a)
- [x] Ć = pop a push enclosed a: a + a[0]
- [x] Ž 12 = <s> break/end if stack is empty</s> → Two-char compressed number
- [x] ƶ = pop a push lifted a, each element is multiplied by its index (1-indexed)
- [x] Ā = pop a push truthified a
- [x] ‘ - = for compressed strings (upper)
- [x] ’ - = for compressed strings (no implicit space)
- [x] “ - = for compressed strings (normal)
- [x] ” - = for compressed strings (title)
- [x] • 15 = start/end a 1-9 char compressed string
- [x] – 16 = pop a if 1, print N (used in loops)
- [x] — 17 = pop a if 1, print y (used in loops)
- [x] ˜ = pop a push deep flattened a
- [x] ™ 19 = pop a push title_cased(a)
- [x] š 20 = pop a push switch_cased(a)
- [x] › 21 = pop a,b push a > b
- [x] œ 22 = pop a push permutations(a)
- [x] ć = pop a push head_extracted a: a[1:], a[0]
- [x] ž 23 > ža push current hours
- [x] žb push current minutes
- [x] žc push current seconds
- [x] žd push current microseconds
- [x] že push current day
- [x] žf push current month
- [x] žg push current year
- [x] žh push [0-9]
- [x] ži push [a-zA-Z]
- [x] žj push [a-zA-Z0-9_]
- [x] žk push [z-aZ-A]
- [x] žl push [z-aZ-A9-0_]
- [x] žm push [9-0]
- [x] žn push [A-Za-z]
- [x] žo push [Z-Az-a]
- [x] žp push [Z-A]
- [x] žq push pi
- [x] žr push e
- [x] žs pop a, push pi to a digits (max. 100000)
- [x] žt pop a, push e to a digits (max. 10000)
- [x] žu push ()<>[]{}
- [x] žv push 16
- [x] žw push 32
- [x] žx push 64
- [x] žy push 128
- [x] žz push 256
- [x] žA push 512
- [x] žB push 1024
- [x] žC push 2048
- [x] žD push 4096
- [x] žE push 8192
- [x] žF push 16384
- [x] žG push 32768
- [x] žH push 65536
- [x] žI push 2147483648
- [x] žJ push 4294967296
- [x] žK push [a-zA-Z0-9]
- [x] žL push [z-aZ-A9-0]
- [x] žM push aeiou
- [x] žN push bcdfghjklmnpqrstvwxyz
- [x] žO push aeiouy
- [x] žP push bcdfghjklmnpqrstvwxz
- [x] žQ push printable ASCII character set (32-128)
- [x] žR push ABC
- [x]
- [x]
- [x] Ÿ 24 = pop (a),b push [a, ..., b] if b not a list, otherwise push [b[0],...,b[1],...,b[n]]
- [x] ā = get a push range(1, len(a) + 1)
- [x] ¡ 25 = pop a,b push a.split(b)
- [x] ¢ 26 = pop a,b push a.count(b)
- [x] £ 27 = pop a,b push a[0:b]
- [x] ¤ 28 = get a push tail(a)
- [x] ¥ 29 = pop a push delta's a
- [x] ¦ 30 = pop a push a[1:]
- [x] § 31 = pop a push str(a)
- [x] ¨ 32 = pop a push a[0:-1]
- [x] © 33 = get a store a in register_c without popping
- [x] ª 34 = pop a push sentence_cased(a)
- [x] « 35 = pop a,b push merged(a,b) if both are lists, else push concatenated(a, b)
- [x] ¬ 36 = get a push head(a)
- [x] λ =
- [x] ® 37 = push the last item from register_c
- [x] ¯ 38 = push global array
- [x] ° 39 = pop a push 10 ** a
- [x] ± 40 = pop a push bitwise not a
- [x] ² 41 = push the second item from the input history
- [x] ³ 42 = push the third item from the input history
- [x] ´ 43 = clear global array
- [x] µ 44 = pop a while counter_variable != a, do...
- [x] ¶ 45 = push newline character
- [x] · 46 = pop a push 2 * a
- [x] ¸ 47 = pop a push [a]
- [x] ¹ 48 = push the first item from the input history
- [x] º 49 = <s>push len(stack) > 0</s> → pop a, push mirrored a
- [x] » 50 = pop (a) if list, join list by newlines, else join stack by newlines
- [x] ¼ 51 = counter_variable += 1
- [x] ½ 52 = pop a, if 1, then counter_variable += 1
- [x] ¾ 53 = push counter_variable
- [x] ¿ 54 = pop (a),b push gcd(b) if b is list, else push gcd([b, a])
- [x] À 55 = pop a push a rotated 1 left
- [x] Á 56 = pop a push a rotated 1 right
- [x] Â 57 = pop a push a, reversed(a)
- [x] Ã 58 = pop a,b push a.keep(b)
- [x] Ä 59 = pop a push abs(a)
- [x] Å 60 = list commands
- [x] Æ 61 = pop a push reduced_substraction(a) if a is list, else reduced_substraction(stack)
- [x] Ç 62 = pop a push ASCII value of a
- [x] È 63 = pop a push a % 2 == 0 (is even)
- [x] É 64 = pop a push a % 2 == 1 (is uneven)
- [x] Ê 65 = pop a,b push a != b
- [x] Ë 66 = pop a push 1 if all equal else 0
- [x] Ì 67 = pop a push a + 2
- [x] Í 68 = pop a push a - 2
- [x] Î 69 = push 0 and input
- [x] Ï 70 = pop a,b push the elements from a at which the same index at b is 1
- [x] Ð 71 = pop a triplicate top of stack (push a, push a, push a)
- [x] Ñ 72 = pop a push divisors(a)
- [x] Ò 73 = pop a push list of prime factors (with duplicates)
- [x] Ó 74 = pop a push list of exponents of prime factors (2^a, 3^b, 5^c, 7^d, etc.)
- [x] Ô 75 = pop a push connected uniquified a
- [x] Õ 76 = pop a push euler_totient(a)
- [x] Ö 77 = pop a,b push a % b == 0
- [x] × 78 = pop a,b push a × b (strings)
- [x] Ø 79 = pop a push ath prime (zero-indexed)
- [x] Ù 80 = pop a push uniquified a
- [x] <s>Ú 81 = pop a push reverse uniquified a</s>
- [x] Û 82 = pop a,b push a with leading b's trimmed off
- [x] Ü 83 = pop a,b push a with trailing b's trimmed off
- [x] Ý 84 = pop a push [0 .. a]
- [x] Þ 85 = pop a <s>push stringified float(a)</s> → cycled a (e.g. `[1, 2, 3] → [1, 2, 3, 1, 2, ...`)
- [x] ß 86 = get a extract smallest element of list
- [x] à 87 = get a extract greatest element of list
- [x] á 88 = pop a push only letters of a
- [x] â 89 = pop a,b push cartesian product
- [x] ã 90 = pop (a),b push cartesian product of b.repeat(2) if b is list, else cartesian product of a.repeat(b)
- [x] ä 91 = pop a,b push a sliced into b pieces
- [x] å 92 = pop a,b push b in a
- [x] æ 93 = pop a push powerset(a)
- [x] ç 94 = pop a push char a
- [x] è 95 = pop a,b push a[b]
- [x] é 96 = pop a push sorted a (key=length)
- [x] ê 97 = pop a push sorted_uniquified(a)
- [x] ë 98 = else statement
- [x] ì 99 = pop a,b push merged(b, a) if both are lists, else a.prepend(b)
- [x] í 13 = pop a push [reversed Q for Q in a] (short for €R)
- [x] î 14 = pop a push round_up(a)
- [x] ï 18 = pop a push int(a)
- [x] ð = push a space character
- [x] <s>ñ = pop a,b,c push a + b merged with c as merge character</s>
- [x] ò = pop a push round to nearest integer(a) (bankers rounding)
- [x] <s>ó = pop a push round_down(a)</s>
- [x] ô = pop a,b push a split in pieces of b
- [x] õ = push empty string
- [x] ö = pop a,b push int(a, b)
- [x] ÷ = pop a,b push a // b (integer division)
- [x] ø = pop (a),b push zipped b if b is list, else zipped a with b
- [x] ù = pop a,b push a with elements of length b
- [x] ú = pop a,b push a padded with b spaces in the front
- [x] û = pop a push palindromized(a), 12345 becomes 123454321 (a + a[::-1][1:])
- [x] ü = pairwise command (vectorizes if the first element is a list)
- [x] ý = pop (a),b push b.join(a) if a is list, else b.join(stack)
- [x] þ = pop a push only digits of a
- [x] ÿ = used for string interpolation, pop a and replace ÿ with str(a)
- [x] <s>.€ = pop a debug printer (default encoding, fallbacks on cp1252)</s>
- [x] <s>.ä = pop a debug printer (cp1252)</s>
- [x] .å = pop a,b push b in a (non-vectorizing results)
- [x] <s>.0 = throw a division by zero error</s>
- [x] <s>.A = pop a push acronymified a</s>
- [x] .b = pop a push letterified(a)
- [x] .B = pop a push squarified(a)
- [x] .c = pop a push centralized(a) focused to the left
- [x] .C = pop a push centralized(a) focused to the right
- [x] .D = pop a,b push b copies of a if b is int, else push len(b) copies of a
- [x] <s>.e = pop a run with experimental python evaluation (does not work in safe mode)</s>
- [x] .E = pop a push(eval(a)) (does not work in safe mode)
- [x] .g = push length of stack
- [x] <s>.h = pop a,b bijectively convert a from base 10 to base b</s>
- [x] <s>.H = pop a,b bijectively convert a from base b to base 10</s>
- [x] <s>.j = pop a 0-indexed max_spaces.join(stack) grid (deprecated)</s>
- [x] <s>.J = pop a 1-indexed max_spaces.join(stack) grid (deprecated)</s>
- [x] .l = pop a push is_lower(a)
- [x] .L = pop a,b push levenshtein(a, b)
- [x] .M = pop a push most frequent in a
- [x] .m = pop a push least frequent in a
- [x] .n = pop a,b push log_b(a)
- [x] <s>.N = pop a push hashed(a)</s>
- [x] .o = pop a,b push overlap(b) (deprecated)
- [x] <s>.O = pop a,b push connected_overlap(b) (deprecated)</s>
- [x] .p = pop a push prefixes(a)
- [x] .Q = pop a,b push a == b (does not vectorize)
- [x] .R = pop a push random_pick(a)
- [x] .r = pop a push random_shuffle(a)
- [x] .s = pop a push suffixes(a)
- [x] .S = pop a,b push 1 if a > b, -1 if a < b, 0 if a == b
- [x] .u = pop a push is_upper(a)
- [x] .V = pop a run as 05AB1E code
- [x] .w = pop a push a.readall() (internet access, doesn't work in safe mode) (returns 0 on error)
- [x] .W = pop a wait a milliseconds
- [x] .x = pop a,b push the element in a closest to b (abs_difference if possible else string distance)
- [x] .$ = pop a,b push a[b:]
- [x] .: = pop a,b,c push a.replace(b, c)
- [x] .; = pop a,b,c push a.replace_first(b, c)
- [x] .¡ = pop a split each element in a based on the result from the function. Usage: .¡\<func>
- [x] .² = pop a push log_2(a)
- [x] .ï = pop a push is int(a)
- [x] .γ = pop a group a by the outcome of the function (usage: .γ\<func>})
- [x] .¿ = pop (a),b push lcm(b) if b is list, else push lcm(b, a)
- [x] .æ = pop a compute permutations by function, usage: .æ\<FUNC>}
- [x] .ā = pop a push a with enumeration (["a", "b", "c"] → [["a", 0], ["b", 1], ["c", 2]])
- [x] .ý = pop a,b push a interspersed with b
- [x] <s>.ˆ = pop a insert a into global array and after quit, print array[input_1]</s>
- [x] <s>.^ = pop a insert a into global array with immediate sorting and after quit, print array[input_1]</s>
- [x] .ø = pop a,b surround a with b
- [x] .« = <s>foldr</s> reduce right reduces using a dyadic command between each element in a list from right to left
- [x] .» = <s>foldl</s> reduce left reduces using a dyadic command between each element in a list from left to right
- [x] .¼ = pop a tan(a)
- [x] .½ = pop a sin(a)
- [x] .¾ = pop a cos(a)
- [x] .À = rotate stack 1 left
- [x] .Á = rotate stack 1 right
- [x] <s>.× = pop a,b push the list a repeated b times</s>
- [x] .• = decompress a base 255 alphabet based string
- [x] .º = pop a push intersected mirror a
- [x] .¥ = pop a push undelta a
- [x] <s>.ǝ = pop a print a to STDERR</s>
- [x] .∊ = pop a push intersected vertical mirror a
- [x] .Λ = pop a,b,c store a canvas with {a: num, b: filler, c: pattern} and push the string to the stack
- [x] .Ø = pop a push 0-indexed number of the greatest prime ≤ a
- [x] .ò = pop a,b round a with b digits precision
- [x] .Œ = pop a,b push all possible ways to divide a into b pieces
- [x] .£ = pop a,b push a[:-b]
- [x] .œ = pop a push partitions(a)