# Print every character your program doesn't have

Your task is to build a program (using only printable ASCII characters and/or tabs and newlines) that prints out exactly the characters in the printable ASCII space (0x20 to 0x7e) that don't appear in your program's source code (in any order, however many times you want).

The shortest code to do this in any language wins.

• They are, but they're not in the range 0x20 to 0x7e, which are defined as the "printable ASCII characters". Technically tabs and newlines are actually control characters. – Joe Z. Aug 23 '13 at 19:22
• Are we allowed to print newlines (or any other unprintable ASCII characters)? – flornquake Aug 24 '13 at 0:30
• Tabs and newlines do not render in such a way that they occupy a printing position. They move the position. See the ANSI C "isprint" function. – Kaz Aug 24 '13 at 2:00
• How did this question get revived? It's started getting upvotes again. – Joe Z. Jan 31 '14 at 16:38
• @Timwi: If you wanted to do that, you'd have to output all the characters in the CJK character space too (excluding the ones appearing in your code). It's too complicated to manage, so I restricted it to just ASCII. – Joe Z. Feb 1 '14 at 3:01

# Cubically, 61 bytes

~:5+1-777(B1D1+7)6+33077777(D3B3@6-7)0&2 !"#$%'*,./489;<=>?AC  ### Unique characters in program:  !"#$%&'()*+,-./0123456789:;<=>?@ABCD~


### Output:

EFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}


# Python 2, 68 8388 (but it actually reads the file)

No comments, no hacks, it just opens itself, and checks the contents. Includes the set logic from this answer.

print"".join(set(map(chr,range(32,127)))-set(open(__file__).read()))


Changed to print the output and not an array.

• Outputs the following characters which are in the program:  127[]acdefrtx – user8943 Aug 24 '13 at 2:24
• @ZeroPiraeus I've corrected that, and have met your score! – user8777 Aug 24 '13 at 5:47
• These are definitely not ASCII characters. ASCII below 32 only contains control codes (Backspace, Bell, etc.), whitespace (CR, LF, tab), and the null char. – Felix Dombek Aug 24 '13 at 13:25
• @Felix These are from Code page 437 (which starts at U+2639, I believe) – Doorknob Aug 24 '13 at 15:02
• You can get this down to 62 chars in python3 using @WolframH 's idea: print(*set(map(chr,range(32,127)))-set(open(__file__).read())). Longer by 1 character than the other answer, but more pythonic in my opinion – Peter Gibson Aug 29 '13 at 1:47

## Bash (pure), 9392 88 bytes

eval "a=$'$(printf '\\x%x' {32..127})'"
while read -rn1 c;do a=${a/"$c"};done<$0 echo$a


### Example

cat > foo.sh # now paste and C-d
bash foo.sh  # !#&*+,45689:>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_bgjkmqsuyz|~
wc -c foo.sh # 93 (including end-of-line \n)


• The eval thing: construct a string that looks like \x20\x21...\x7f, and use bash&ksh's c-style-quote $'c-escape-str' to wrap it, in order to escape it into some real list-of-chars. • Then we use a while loop to read chars one-by-one, and use the 'replace first occurance' ${var/pat} to kill corresponding chars in $a. Note that we didn't set IFS properly, and read by default will consume \x20, \n and \t. The \x20 part will be handled later. • Finally we abuse IFS again so it can eat the space. The output is in ASCII char order. This very literal (for code golfs at least) one actually ended up smaller than what I expected it to be. Otherwise I will be thinking about # !&*+abc.... # brainfuck, 90 bytes ++++[->+++>++++++++<<]>-[->.>+<+<]>+.+++>++[-<.<++>+>]<+.++<++[->.>+<+<]>+.++>+++++[-<.+>]  Try it online! Tape Layout: [Initial Count Cell] , [Counter Cell One] , [Ascii Cell] , [Counter Cell Two] Explanation: ++++[->+++>++++++++<<]>- # sets counter cell one to 11 and ascii cell to 32 [->.>+<+<] # prints ascii 32-42 and creates counter cell two >+.+++>++ # prints ascii 44 and sets counter cell two to 13 [-<.<++>+>] # prints ascii 47-59 and resets counter cell one <+.++<++ # prints ascii 61 and sets counter cell one to 28 [->.>+<+<] # prints ascii 63-90 and resets counter cell two >+.++>+++++ # prints ascii 92 and sets counter cell two to 33 [-<.+>] # prints remaining ascii characters  Output:  !"#$%&'()*,/0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\^_abcdefghijklmnopqrstuvwxyz{|}~


# R, 72 bytes

cat(intToUtf8(setdiff(32:126,utf8ToInt("\\\"(),12368:ITUacdefinostu"))))


Try it online!

With correction from @JayCe

• nicely done! Beats out the default polyglot by a fair margin! – Giuseppe May 15 '18 at 18:49
• I think you're missing \\  in the string which costs 2 bytes :( Otherwise I tried to golf it further but couldn't - clever use of setdiff ! – JayCe May 16 '18 at 20:21

# Q, 44

-1"c"$til[128]except"i"$"-1\"c$til[28]exp;";  . q)-1"c"$til[128]except"i"$"-1\"c$til[28]exp;";
345679:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\^_abdfghjkmnoqrsuvwyz{|}


C++ 143

#include<fstream>
#include<iostream>
char c[256],d,e=32;int main(){for(std::fstream i(__FILE__);i>>d;)c[d]++;for(;++e<127;)c[e]||std::cout<<e;}


Alternative version using macros - 155

#include"iostream"
#define d int main(){while(s,*s)l[*s++]++;for(e=35;++e<127;)!l[e]&&std::cout<<e;}
#define t(a)#a
#define f(a)t(a)
char*s=f(d),l[257],e;d


And a version without 'reflection' (examining own source) - 139

#include"iostream"
char h['~'],*a="'()*+,:;<=[]acdefhilmnorstu{}",i='#';int main(){for(;*a;)h[*a++]++;for(;++i<'~';)if(!h[i])std::cout<<i;}


# Bash, with coreutils, 80

p=printf
for o in {32..126};{
c=$p$($p "\%o"$o)
grep -qF "$c"$0||$p "$c"
}


Output is:

!#&'}+,/45789:<>}@ABCDEGHIJKLMNOPQRSTUVWXYZ[]^_abhjklmsuvwxyz~

• Never heard about this for v in something; COMPOUND_CMD syntax. Great… – Arthur2e5 Mar 2 '16 at 8:13

### How It Works:

"   Wrapping string literal, adding the source code to the stack.
This adds a space at the start to initialise the counter
'  Runs another string literal over the whole code
This means both " and ' are added to the stack
r:  Get the counter from the bottom of the stack and duplicate it
{-}  Get the bottom of the stack and check if it is equal to the counter. Push the check to the bottom of the stack
30  Add 3, 0 to the stack for later
{l4-*  Get the equality check from the bottom of the stack and OR it with whether the stack is empty of values to check against
?.  If the character is equal or the stack is empty, continue.
Else set the instruction pointer to 3,0 to check against the next character
~~  Pop the excess 3,0
:9e*=?;  Check if the counter is equal to the 126, the last character, and end if so.
:l2=?o  If the stack is empty of values to check (ie the character is not in the code), print it.
1+}  Add one to the counter and, because ><> is toroidal, loop back to the beginning


# Memory GAP, 3104 bytes

74b87337454200d4d33f80c4663dc5e5f7bd60b75b29d79b660a2859395c1a240e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf47cef8a734855777c2a9d0caf42666e69b21afc54fb48d153c19101658f4a2a480e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf4594f803b380a41396ed63dca39503542f7bd60b75b29d79b660a2859395c1a240e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a092433247bce5c74f589f4867dbd57e9ca9f808f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4594f803b380a41396ed63dca395035420e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a0924332f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a09243320cc175b9c0f1b6a831c399e269772661f7bd60b75b29d79b660a2859395c1a24f24c2c15b9d03797c6874986a8d1951634ec78fcc91ffb1e54cd85e4a0924332faf05c15dfad45dafd1fc23d51236853f0a1dfdc675b0a14a64099f7ac1cee8374b87337454200d4d33f80c4663dc5e5f7bd60b75b29d79b660a2859395c1a240e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e54cd85e4a09243320cc175b9c0f1b6a831c399e269772661f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4594f803b380a41396ed63dca39503542f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a0924332faf05c15dfad45dafd1fc23d5123685334ec78fcc91ffb1e54cd85e4a09243320cc175b9c0f1b6a831c399e269772661f7bd60b75b29d79b660a2859395c1a24f0a1dfdc675b0a14a64099f7ac1cee83f24c2c15b9d03797c6874986a8d1951634ec78fcc91ffb1e54cd85e4a09243327cef8a734855777c2a9d0caf42666e69b21afc54fb48d153c19101658f4a2a48a87deb01c5f539e6bda34829c8ef2368c68271a63ddbc431c307beb7d2918275852438d026c018c4307b916406f98c6274985f5115ad149212a917dbef8ec801b21afc54fb48d153c19101658f4a2a480cc175b9c0f1b6a831c399e269772661f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf474b87337454200d4d33f80c4663dc5e5f7bd60b75b29d79b660a2859395c1a240e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243324124bc0a9335c27f086f24ba207a4912f7bd60b75b29d79b660a2859395c1a24f24c2c15b9d03797c6874986a8d1951634ec78fcc91ffb1e54cd85e4a0924332faf05c15dfad45dafd1fc23d5123685374985f5115ad149212a917dbef8ec801


Try it online!

Expanded:

74b87337454200d4d33f80c4663dc5e5f7bd60b75b29d79b660a2859395c1a240e9f1e8e40bb79e8
00b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4
34ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e
54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf47cef8a734855777c2a9d0caf42666e69
b21afc54fb48d153c19101658f4a2a480e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e8
00b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf4594f803b380a41396ed63dca39503542
f7bd60b75b29d79b660a2859395c1a240e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e8
00b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf4
34ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e
54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a0924332
47bce5c74f589f4867dbd57e9ca9f808f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e
54cd85e4a092433234ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4
594f803b380a41396ed63dca395035420e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e
54cd85e4a0924332f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a0924332
0cc175b9c0f1b6a831c399e269772661f7bd60b75b29d79b660a2859395c1a24f24c2c15b9d03797
f0a1dfdc675b0a14a64099f7ac1cee8374b87337454200d4d33f80c4663dc5e5f7bd60b75b29d79b
660a2859395c1a240e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a0924332
0e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e8
00b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4
0e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e
54cd85e4a09243320cc175b9c0f1b6a831c399e269772661f7bd60b75b29d79b660a2859395c1a24
34ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4594f803b380a4139
6ed63dca39503542f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a0924332
31c399e269772661f7bd60b75b29d79b660a2859395c1a24f0a1dfdc675b0a14a64099f7ac1cee83
f24c2c15b9d03797c6874986a8d1951634ec78fcc91ffb1e54cd85e4a09243327cef8a734855777c
2a9d0caf42666e69b21afc54fb48d153c19101658f4a2a48a87deb01c5f539e6bda34829c8ef2368
12a917dbef8ec801b21afc54fb48d153c19101658f4a2a480cc175b9c0f1b6a831c399e269772661
f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e8
00b0cc9433830cf474b87337454200d4d33f80c4663dc5e5f7bd60b75b29d79b660a2859395c1a24
0e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e8
00b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4
34ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e8
00b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4
34ec78fcc91ffb1e54cd85e4a09243324124bc0a9335c27f086f24ba207a4912f7bd60b75b29d79b
660a2859395c1a24f24c2c15b9d03797c6874986a8d1951634ec78fcc91ffb1e54cd85e4a0924332


## Explanation

Memory GAP's instructions are md5 hashes of their actual instructions. Using ; as a delimiter, this is the "original" program:

;

dup;open;pop;
dup;

dup;
dup;
btwn;

swap;

open;
pop;char;out;nil;shut;pop;

dup;
shut;


This simply iterates over the range between 32 and 126, and prints it if and only if it does not fall between '0' and '9' or 'a' and 'f'.

# Z80Golf, 83 bytes

00000000: 2b2b 7036 092e 452c 453b 3b78 6f2c 4523  ++p6..E,E;;xo,E#
00000010: 2323 2323 2323 2323 2323 2323 2323 2329  ###############)
00000020: 2929 2929 2929 2929 307e 7620 2122 2425  ))))))))0~v !"$% 00000030: 2627 282a 2d2f 3132 3334 3537 3839 3a3c &'(*-/12345789:< 00000040: 3d3e 3f40 4142 4344 7172 7374 7577 797a =>?@ABCDqrstuwyz 00000050: 7b7c 7d {|}  Try it online! Printable characters aren't too useful in z80, but we can write this:  dec hl dec hl ld (hl),b ld (hl),9 ld l,'E' inc l ld b,l dec sp ;$0009 starts here
dec sp
ld a,b
ld l,a
inc l
ld b,l
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
jr nc, $+2+'~' halt db " !\"$%&'(*-/12345789:<=>?@ABCDqrstuwyz{|}"


The idea is to print characters from 'F' to 'n', and put all the remaining characters in the code (the "garbage" string at the end).

The preamble writes 09 (tab) to $fffe, so that we can point SP there to jump to $0009 after putchar. The ld (hl), b achieves nothing; I just get rid of 'p' there.

L is initialized to 'E'+1, and counts up until (HL+17) << 9 overflows (sets the carry), which is when L is 111 = 'o', the first character we don't want to print.

If the carry is not set, we jump over a halt instruction and the garbage string, into thousands of NOPs, the PC eventually running into putchar = $8000 and returning to $0009.

See this answer for some more info on how this code prints characters in the first place.

• nvm I saw that the code had to be printable as well. – qwr Jun 20 '18 at 19:16

# Ruby (50)

puts (?#..?~).to_a.join.tr"()?!#.,~_aijnoprstu",""


Outputs:

$%&'*+-/0123456789:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^bcdefghklmqvwxyz{|}  ## Python, 94 print !"#$%&'90*+,-.0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[/\]^_abcdefghjklmoqsuvwxyz{|}

• The "do nothing" solution was already posted. – Joe Z. Nov 27 '13 at 22:15
• @JoeZ. I've changed it to do something – Timtech Nov 28 '13 at 12:06

# Ruby 2.1.0

## 206 204 characters

chars_in_source = File.read("self.rb").chars.uniq.map(&:ord)
printable_ascii = (20..126).to_a
not_in_source = printable_ascii.reject { |c| chars_in_source.include?(c) }

puts not_in_source.map(&:chr).join


And the output is:

#$%'*+,-/345789;<>@ABCDEGHIJKLMNOPQRSTUVWXYZ[\]^gkvwxyz~  Not the shortest here (in fact, it might be the longest). But that's the great thing about this: it got me to go try something I'd never done before. • VariableNamesGreaterThanOneCharacterLongException on line 1 – CalculatorFeline Mar 2 '16 at 4:38 # Python, 88 81 78 77 bytes ## actually reads the file I tried to do it the 'clean' (as in 'easy to read') way, turned out quite nice, although i'm still new to python and probably this can be shortened as well. file named 'a' is the file executed. from string import* for c in printable: if c not in open('a').read():print c  And it prints out all the ASCII characters not found in source file. I know this was supposed to be a clever hack (as in all those which contain all the ascii set or addresses, or use an error), but I wanted to do explicitly what was asked :] Anyone has a suggestion how to make it even shorter while still going in this direction?  trimmed one more char, thanks for the tip! • Timtech's tip makes possible to reduce 1 more character. – manatwork Jan 31 '14 at 12:30 ### Javascript 78 chars bghjklm()seuABCDEFGHIJKLMNOPQRSTUVWXYZvwyz!@#$%^&*1234567890{}[]-=_+\;"'.,<>/?


Outputs:

SyntaxError: Unexpected identifier


Not the shortest code, but threw a try for fun. Notice the colon (:) and space () are covered in Output also.

Feedback appreciated.

• And I just notice now that @xem has already done something similar to my code. Sorry, at CodeGolf people (and xem), if you all consider what I did unknowingly is copying another's work, I will happily delete my answer. – Gaurang Tandon Jan 31 '14 at 14:54

# PYG 0.1 (17):

P(*Se(STP)-Se(Q))


prints

$, 0 4 8 < @ D H L X \  d h l p t x | # ' + / 3 7 ; ? C G K O W [ _ c g k o s w { " & . 2 6 : > B F J N R V Z ^ b f j n r v z ~ ! % 1 5 9 = A E I M U Y ] a i m q u y }  Not the shortest, but it gets the job done. Also, since I just created this "Language" (it's actually shortend Python), I'll explain what it does. • Q gives the program's code • STP gives all printable characters • Se is equal to Python's set • - substracts the two sets • * is also the same as python's • P prints it. Knowing this, this would convert to the following python: for i in set(__import__("string").printable)-set(open(__file__).read()): print i # Befunge, 44 characters $#~"01g!#@_:01>g#1-#0*#:_!> #,!#g!_01g1+01p


it has exactly one quotation mark in the code, so that whenever it is executed, the program enters string mode, reading the code until it loops back to the same quotation mark, stops string mode and continues execution.

it does this for every printable ascii character, rejects it if it's in the code and continues. maybe i'll golf it more later

# CBM BASIC v2.0 - 63

0fori=84+5to127.
3?chr$(i);:next 6rem "!#%&'*,-/<>@abdgjklmpqsuvw  # ><>, 86 bytes Naive implementation : for each character in the 0x20 - 0x7e range, browse its codespace until it reaches the character or the end of the codespace. ' 'v1+>}:{:@@g:?!v{:}=?v30. > >00^ 0+1v!?~< ^+1;?='~':< ~~< ~:o ^ >  Output : "#$%&()*,-/2456789ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]_abcdefhijklmnpqrstuwxyz|


This is definitely golfable, I'll try to improve the flow control later.

say [~] keys (' '..'~') (-)$*PROGRAM.comb # 41 bytes  IYZnCpl?W8|}K!^i"Bhuvw6F<\S,=JrVLQE54%Xqg_1{/3+Tjx#Ht&;7>02@ND:9Udfz  The reason the order of the output is random is that the Set Minus operator (-) produces a Set, which is inherently unordered. # Javascript/coffeescript/actionscript/more, 96 // #qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890~!@$%^&*()-_=+[{]}\|;:'",<.>?


Other languages it works in are basically anything with // comments (and doesn't need something like class a{public static void main(String[]a){) This also works in Perl 5 (Thanks @BradGilbertb2gills for pointing that out!)

• I was just about to comment that this would work in almost any language... – Sparr Nov 18 '15 at 23:47
• # qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890~!@/$%^&*()-_=+[{]}\|;:'",<.>? Python - 95 bytes EDIT: Damn code blocks – DJgamer98 Nov 19 '15 at 14:59 • If you placed the # character before qwerty then it will also work in Perl 5. – Brad Gilbert b2gills Nov 29 '15 at 19:16 • @BradGilbertb2gills cool! – ev3commander Nov 29 '15 at 21:17 • Perl 5 will either see // as a null regex, or a defined-or operator. (say undef // 1) I'm not sure which. ( If it is the latter, it may only work on 5.10 or newer ) – Brad Gilbert b2gills Nov 29 '15 at 21:41 # Lua, 94 bytes f="l=...for i=32,126 do c=string.char(i)io.write(l:find(c,0,1)and\"\"or c)end"loadstring(f)(f)  Writes the algorithm in a string and uses loadstring to run it as a function passing in its string definition as the argument. • Hello, and welcome to Programming Puzzles and Code Golf! Great answer! – NoOneIsHere May 10 '16 at 23:25 # Smalltalk - 47 ^#DI,($ to:$~)difference:thisContext sourceCode  This works in Squeak 6.x and produces the String: '!"%&''*+-./0123456789;<=>?@ABEFGHJKLMNOPQRSTUVWXYZ[\]_abgjklmpqvwyz{|}'  • ($ to:$~) forms a left String ranging the 95 characters • thisContext sourceCode produces a decompileString of the snippet • difference: reject all the caracters from the left String that appears in the decompileString. • #DI, which concatenates a Symbol with letters D and I to left String is here to make those 2 letters appear in code. It is necessary because the decompileString prefixes the snippet with DoIt ^ which is the name of the pseudo-method. Those letters will thus be removed. Same for the leading ^ that indicates to return the result, it is in the decompileString so has to be in the code even if optional Letters o and t are already in source code, so it's OK. • 'DI', would work but result string is printed with quotes ' so source must not have quotes • "DI" would be even shorter, unfortunately decompileString remove comments • We could eliminate method name with ($ to:\$~)difference:(thisContext sourceCode last:52) but it is longer (52)

The code consumes 25 different characters, and thus produces 70 different characters (among 73, quote ' appearing 3 more times for printing the String)

# RProgN 2, 24 bytes

{{. ~Rx={x\-x=};x.}{
`

Try it online!