05AB1E, 130 133 144 148 150 151 155 156 157 159 programs
Uses the custom 05AB1E encoding for all programs.
All programs are a TIO-link to verify them.
Either type of input is fine:
1) (empty program): Implicit input is output implicitly
2,3)
(a space), \n
(a newline): The whitespaces are ignored; implicit input is output implicitly (with trailing newline)
4) w
: Unbound no-op; implicit input is output implicitly (with trailing newline)
5) I
: Explicit input is output implicitly (with trailing newline)
6) ¹
: Explicit first input is output implicitly (with trailing newline)
7) $
: Push 1 and the input, after which the top input is output implicitly (with trailing newline)
8) Î
: Push 0 and the input, after which the top input is output implicitly (with trailing newline)
9) ,
: Implicit input is output explicitly with trailing newline
10) =
: Implicit input is output explicitly with trailing newline (without popping)
11) ?
: Implicit input is output explicitly without trailing newline
12) q
: Exit program; implicit input is output implicitly (with trailing newline)
13,14) D
, Ð
: Duplicate / triplicate the implicit input and output the top implicitly (with trailing newline)
15) r
: Reverse the values on the stack (which is empty); implicit input is output implicitly (with trailing newline)
16,17) s
, Š
: Swap / triple swap two / three implicit inputs; the top is output implicitly (with trailing newline)
18) Δ
: Loop until the result no longer changes; the implicit input is used, it loops twice, and the unmodified input is output implicitly (with trailing newline)
19) :
: Replace the implicit input-string with the implicit input-string, after which the unmodified input is output implicitly (with trailing newline)
20,21,22,23) J
, »
, O
, P
: Join the empty stack without delimiter / join the empty stack with newline delimiter / sum the empty stack / take the product of the empty stack, after which the implicit input is output implicitly (with trailing newline)
24,25) U
, V
: Pop the implicit input, and store it in variable X
or Y
respectively, after which the implicit input is output implicitly (with trailing newline)
26) ©
: Store the implicit input in variable ®
(without popping), after which it is output implicitly (with trailing newline)
27) ˆ
: Pop the implicit input, and add it to the global array, after which the implicit input is output implicitly (with trailing newline)
28) i
: If-statement, if the (implicit) input is 1 it enters it. But whether the input is 1 and it enters the if-statement or not, the implicit input is output implicitly (with trailing newline) either way
29) v
: For-each over each character/digit of the implicit input (but don't push any, since we don't use y
). After the loop, the implicit input is output implicitly (with trailing newline)
30,31) }
, ]
: Close the inner-most or all if-statement(s)/loop(s), for which there are none right now. The implicit input is output implicitly (with trailing newline)
32) †
: Filter the implicit input to the front of the implicit input; it will remain unmodified and is output implicitly (with trailing newline)
33) ‡
: Transliterate the characters of the implicit input to the characters of the implicit input; it will remain unmodified and is output implicitly (with trailing newline)
34) ´
: Clear the global array (which is already empty). After which the implicit input is output implicitly (with trailing newline)
35) §
: Cast the implicit input to a string, after which it is output implicitly (with trailing newline)
36) Ã
: Keep all values of the implicit input in the implicit input, after which the unmodified result is output implicitly (with trailing newline)
37) é
: Sort the implicit input by length. Since it's a single string/integer, the characters/digits will remain at the same position, after which the unmodified input is output implicitly (with trailing newline)
38,39) .
, Å
, ž
: All three are used to open up more 2-byte operations, but on their own they're unbound no-ops. So the implicit input is output implicitly (with trailing newline).
40) \
: Discard the top item on the stack (which is already empty), after which the implicit input is output implicitly (with trailing newline)
41) ¼
: Increase the counter_variable by 1. After which the implicit input is output implicitly (with trailing newline)
42) ½
: If the implicit input is 1
, increase the counter_variable by 1. After which the implicit input is output implicitly (with trailing newline)
43) ë
: Else-statement, which is a no-op without if-statement. So the implicit input is output implicitly (with trailing newline)
44) ÿ
: Used for string interpolation; outside of a string it's a no-op. So the implicit input is output implicitly (with trailing newline)
45) šн
: Convert the implicit input implicitly to a character-list, and prepend the implicit input at the front. Then pop and push the first item of this list, which is output implicitly (with trailing newline).
46) ªθ
: Convert the implicit input implicitly to a character-list, and append the implicit input at the end. Then pop and push the last item of this list, which is output implicitly (with trailing newline).
47) η¤
: Get all prefixed of the implicit input. Push its last item (without popping), after which the top of the stack is output implicitly (with trailing newline).
48) ðý
: Join the empty stack with space delimiter, after which the implicit input is output implicitly (with trailing newline).
49) õK
: Remove all empty strings from the implicit input, after which the unmodified result is output implicitly (with trailing newline).
50) ¸`
: Wrap the implicit input into a list, and then pop and dump the contents of that list to the stack, after which it is output implicitly (with trailing newline)
51) ʒX
: Start a filter, and push variable X
, which is 1 (truthy) by default. So all characters/digits in the implicit input will remain, and the unmodified input is output implicitly (with trailing newline)
52) RR
: Reverse the implicit input, and reverse it back. After which the unmodified input is output implicitly (with trailing newline).
53) ÂÂ
: Bifurcate (short for Duplicate & Reverse copy) twice, after which the unmodified input at the top of the stack is output implicitly (with trailing newline)
54) ÁÀ
: Rotate the implicit input once towards the right, and then back towards the left. After which the unmodified input is output implicitly (with trailing newline).
55) ƨ
: Enclose the implicit input, appending its own first character/digit, and then remove the last character/digit again. After which the unmodified input is output implicitly (with trailing newline).
56) Σ9
: Sort the characters/digits in the implicit input by 9 (so they'll all stay at the same positions), after which the unmodified input is output implicitly (with trailing newline).
57) 8ì¦
: Prepend an 8
in front of the implicit input, and then remove the first character again. After which the unmodified input is output implicitly (with trailing newline)
58) āĀÏ
: Push a list in the range [1, implicit input-length] (without popping). Python-style truthify each value in this list (so they'll all becomes 1s). Only keep the characters/digits of the implicit input at the truthy (1) indices, after which the unmodified result is output implicitly (with trailing newline).
59) ""«
: Append an empty string to the implicit input, after which the unmodified input is output implicitly (with trailing newline).
60,61) ‘‘Û
, ’’Ü
: Trim all leading / trailing empty strings of the implicit input, after which the unmodified input is output implicitly (with trailing newline).
62) ““¡
: Split the implicit input on an empty string, after which the unmodified input is output implicitly (with trailing newline).
63) ₆¢
: Count the amount of 36 in the implicit input. Not sure why, but when using a multi-character value with the count, there seems to be a bug and it results in the unmodified string, instead of the actual amount of 36
substrings in the string I was expecting.. So this will output the unmodified input implicitly (with trailing newline).
Only string input:
64 through 125) ǝαβив!%&(*+-/÷;<>BLbcefhjmnoptxz~‰£°±·¿ÃÆÈÉÌÍÑÒÓÕÖרÝãäçèîôöùú
: All these are integer operations (see the Wiki-page linked in the title to see what each does). They are no-ops for the (implicit) input-string(s); after which the unmodified input at the top of the stack is output implicitly.
126) ∍
: Extend/shorten the implicit input-string to a size equal to the implicit input-string, after which it is output implicitly (with trailing newline).
127) δ
: Apply double-vectorized. For integer inputs, it will implicitly convert to a \$[1, a]\$ range before applying double-vectorized. For strings, the implicit input is output implicitly.
128) Λ
: Apply the Canvas with three options. For the digits 0
through 7
, it will output the digit in a certain direction and length, depending on the input. For any other input, it will be a no-op outputting the implicit input implicitly (with trailing newline).
129) –
: If the top of the stack is 1
, it will print index N
. So this will output 0
for input 1
, but will output the implicit input itself implicitly (with trailing newline) for any other input.
130) —
: If the top of the stack is 1
, it will print item y
. So this will output an empty string for input 1
, but will output the implicit input itself implicitly (with trailing newline) for any other input.
131) œW
: Get all permutations of the implicit input-string. Then push the minimum (without popping), which for string inputs will simply use the very first string. Then output this unmodified input at the top of the stack implicitly (with trailing newline).
Only string input, and the output is a character-list:
132) S
: Convert the implicit input to a list of characters and output it implicitly (with trailing newline).
133,134) ε
, €
: Map over each character in the implicit input, and output the resulting character-list implicitly (with trailing newline).
135) gι
: Push the length of the implicit input. Uninterleave the implicit input using this length as block-size. After which the resulting character-list is output implicitly (with trailing newline).
136) øøø¬
: Zip/transpose three times; swapping rows/columns. If it's a matrix, it will do as expected. If it's a string or list, it will use the implicit input as a pair-and-zip/tranpose. Since we're doing it three times, the following will happen: "abc"
→ ["aa","bb","cc"]
→ [["a","aa"],["b","bb"],["c","cc"]]
→ [["a","b","c"], ["aa","bb","cc"]]
. Then we'll push the first inner list (without popping), after which this list at the top of the stack is output implicitly (with trailing newline).
137) ü1
: ü
is the overlapping builtin. It can be used with any other builtin to execute that builtin on every overlapping pair. But it can also be used with a single digit to create overlapping pair (2), triplets (3), quartets (4), etc. Apparently it also works with 1 to just convert the (implicit) input-string into a character-list, which is output implicitly (with trailing newline).
Only character-list input:
138) í
: Reverse each character in the implicit input-list, after which the unmodified input-list is output implicitly (with trailing newline).
139) ˜
: Flatten the implicit input-list, after which the unmodified input-list is output implicitly (with trailing newline).
140) ζζΩ
: Zip/transpose the (implicit) input-list twice: ["a","b","c"]
→ [["a","a"],["b","b"],["c","c"]]
→ [["a","b","c"],["a","b","c"]]
. And then pop and push a random item of this list of lists, which are both the unmodified input-list. After which it will be output implicitly (with trailing newline).
Only integer input:
141,142,143,144) E
, F
, G
, ƒ
: Start a ranged loop with the implicit input (E
= \$[1, a]\$; F
= \$[0, a)\$; G
= \$[1, a)\$; ƒ
= \$[0, a]\$), and output the implicit input implicitly (with trailing newline) afterwards.
145) ï
: Convert the implicit input to an integer, after which the unmodified input is output implicitly (with trailing newline).
146) ò
: Round to the nearest integer (which it already is), after which the unmodified input is output implicitly (with trailing newline).
147) þ
: Only keep the digits of the implicit input-integer, after which the unmodified input is output implicitly (with trailing newline).
148) #
: Split the implicit input-integer by spaces (it has none), after which the unmodified input is output implicitly (with trailing newline).
149,150,151) u
, l
, ™
: Convert the implicit input-integer to uppercase / lowercase / titlecase, after which the unmodified input is output implicitly (with trailing newline).
152) ¶м
: Remove all newline characters of the implicit input-integer, after which the unmodified input is output implicitly (with trailing newline).
153) ‚ß
: Pair the implicit input-integer with the implicit input-integer, and then pop and push its minimum. After which it is output implicitly (with trailing newline).
154) AÚ
: Trim leading and trailing lowercase alphabets of the implicit input-integer, after which the unmodified input is output implicitly (with trailing newline).
155) |M
: Push all inputs as list. Push the largest value on the stack (including in all inner lists/matrices). After which the top of the stack is output implicitly (with trailing newline).
156) ∞@0k
: Push an infinite positive list [1,2,3,...]. Check for each value if the (implicit) input is larger than or equal to this value (1 if truthy; 0 if falsey). And then get the 0-based index of the first 0 in this infinite list. After which it is output implicitly (with trailing newline).
157) µ¾Ê
: Continue looping until the counter_variable (default 0) is equal to the implicit input-integer. Push the counter_variable each iteration, and check that it's NOT equal to the implicit input-integer. If this is truthy, the counter_variable will implicitly be increased by 1 after every iteration. When it becomes falsey, it means it's equal to the input-integer, and thus the loops stops, after which the counter_variable is output implicitly (with trailing newline) as result.
158) Έ
: Push all substrings of the implicit input-integer, and then pop and push its maximum. After which this top of the stack is output implicitly (with trailing newline).
159) Z)Z
: Get the largest digit of the implicit input-integer (without popping). Then wrap all values on the stack into a list, which is the input itself and its max digit. And then get the maximum again of this integer-pair (without popping), which will be the input itself. Then output the input at the top of the stack implicitly (with trailing newline).
Unused characters / builtins:
I'm pretty sure nothing useful is left anymore now..
Integer constants: 234567Tт₁₂₃₄₅Y®N•
Empty list constant: ¯
Empty string constant (if used twice): ”
(Partially) uniquify / sort builtins: Ù{êÔγ
Convert from binary/hexadecimal to integer (which works on any input unfortunately): CH
Checks resulting in truthy/falsey (0/1): Θ≠Qad›‹Ëå
Recursive environment (which I can't close without `}` nor `]`): λ
Infinite loop (which I can't stop without `#` nor `q`): [
(Compressed) string/integer builtins, which result in errors on their own: '„…ƵŽ
Ord (convert to codepoint integers): Ç
Convert to a list and cycle infinitely: Þ
Only leave the letters (which won't work if the input contains anything else): á
Get the second or third input (we are only allowed to take a single input): ²³
Palindrome / mirror: ûº
Cartesian product: â
float
valid, which casts the integer to a float? \$\endgroup\$