221
51
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.
"The shortest code to do this in any language wins." is unclear. Do you mean there is a single winner, over all languages? Or do you mean there's a winner per language? – Don Hatch – 2015-10-03T21:57:49.900
tabs and newlines are printable ASCII characters. – Bakuriu – 2013-08-23T18:49:42.060
19They are, but they're not in the range
0x20
to0x7e
, which are defined as the "printable ASCII characters". Technically tabs and newlines are actually control characters. – Joe Z. – 2013-08-23T19:22:57.3003Are we allowed to print newlines (or any other unprintable ASCII characters)? – flornquake – 2013-08-24T00:30:30.740
1Tabs 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 – 2013-08-24T02:00:48.233
What is the universal set, whose subset you ask to negate? I also do not understand were is the self-reference in all those answers. – Val – 2013-08-24T10:50:03.000
@Val agreed, so far most answers just explicitly print out characters, rather than referring back to the original file. – None – 2013-08-24T22:45:46.957
@LegoStormtroopr The program doesn't have to actually refer to its own source code. It just needed to, as I said, print out exactly those characters its source code doesn't have. – Joe Z. – 2013-08-24T23:31:52.383
1Can we output non-ASCII characters as well? – caird coinheringaahing – 2017-11-23T16:19:48.610
1How did this question get revived? It's started getting upvotes again. – Joe Z. – 2014-01-31T16:38:00.540
Ah, I see. It was posted on Hacker News.
– Joe Z. – 2014-01-31T19:45:55.710I’m disappointed that you decided to restrict this to ASCII-based languages only. Otherwise
– Timwi – 2014-01-31T22:46:23.963글⓵돠上字終
would have been a valid 6-character solution in Sclipting. It outputs all the ASCII characters and doesn’t have any of them in its source.3@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. – 2014-02-01T03:01:29.007
@cairdcoinheringaahing I interpret as only print printable ASCII characters or (tabs and newlines) – qwr – 2018-06-20T19:21:57.037
Does it means writing a program contains all printable ascii as comment (or non-functional codes) and print nothing is valid? If so, any language who support comments should be able to do this in <100bytes. – tsh – 2019-10-16T02:22:20.830