05AB1E, 88 4 distinct bytes
žĆISk'>×€"žĆ0ÿè"J…J[„)\ìNú₅ö©g₅Qi®ƒ„.V«g}¤…B.VJ?q
Try it online. No TIO of the actual program, since the output would be way too big. It basically encodes the input-program into a program using the approach I've also used in the Fewest (distinct) characters for Turing Completeness challenge.
Try it online (with ƒ„.g}¤…B.V
replaced with "D>gB.V"
so we push the number instead of that many .g
or try it online (with ®
replaced with 9
as an example).
Explanation:
žĆ[ # PushStart thean 05AB1Einfinite code-pageloop:
„)\ì IS # Push Prepend ")\" in front of the (implicit) input,
and convert it to aNú list of characters
k # Get the index of each character in # Pad it with the codepageloop-stringindex amount of leading spaces
'>× '# Convert₅ö each index to a string of that many repeated ">"-characters
€ # For eachConvert ">"it from a base-255 string: to a number
"žĆ0ÿè" © # MapStore itthis tonumber thein stringvariable "žĆ0ÿè",`®` (without popping)
g₅Qi # whereIf the `ÿ`length of this number is automatically255:
filled with ®ƒ„.g} # Push `®` + 1 amount of ".g" to the ">"-stringstack
J ¤ # Join these stringsTail together(without popping): pushes "g"
…J …B.V«V # And append "JPush "B.V"
at J # Join the endstack together
? # After which we output the string ? # Output it without trailing newline
q # And stop the program
This will produce a program with the 84 distinct bytes žĆ0>èJ.VgBV
in the following format:
MultipleLoads and loads of žĆ0>...>èg
for each character of the program we input (where theto push a huge number. Then one additional >...>g
are between potentially none up+g
to a maximum of 256 amount ofpush 255, followed by >B.V
):.
- Loads of
žĆ.g
: Push the 05AB1E code-pageamount of items on the stack, which will become one larger every time, where only the last two are relevant 0g
: Push a0
- A certain amount of
>
Pop the top number, and push its length (potentially none, up to a maximum of 256which will always be 255), which each increases by 1 èB
: Index this integer intoConvert the codelarge number to base-page string
And after that:
- 255, resulting in the original input-program with prepended
J)\
: Join these indexed characters on, to clean the stack together without delimiterfrom all the numbers we've pushed with.g
()
wraps the entire stack into a list and\
discards it) .V
: And evaluate this stringExecute it as 05AB1E code- (after which the result is output implicitly)
Try such a program for Aû
Try such a program for Aû
(with the many .g
replaced with a huge number plus additional D>
). Aû
will push the lowercase alphabet & palindromizepalindromizes it).