Your challenge, should you choose to accept it, is to write a program in a language of your choice that, when given a string (limited to printable ASCII) as input, outputs a new program in the same language that outputs that string without using any characters from that string in the code.
But this task is impossible as-is in many languages; for example, if the string to print contains every ASCII character. So instead, your submission will choose a subset of printable ASCII which is guaranteed not to be in the input. Your score will be the size of the set, with lower score being better, and shortest code length (in bytes) as a tiebreaker.
An example solution might be the following:
Python, 64 bytes / score 17
lambda s:"print('\\"+'\\'.join([oct(ord(c))[2:]for c in s])+"')"
Restricting the set
print()'\01234567
.
Now that's enough dawdling—go program!
Rules / clarifications
- "Same language" includes any compiler flags used in the submission.
- The outputted program should be a full program with output on STDOUT.
[:print:]
class (ASCII range 0x20–0x7E)? Thus, it includes the whitespace 0x20, but not the TAB 0x09? \$\endgroup\$