| Bytes | Lang | Time | Link |
|---|---|---|---|
| 095 | tinylisp | 250403T170904Z | Andrew B |
| 013 | Japt | 190411T215737Z | Shaggy |
| 011 | Vyxal | 230922T224906Z | ffseq |
| 469 | PHP 5.2 | 130827T190239Z | Ry- |
| 198 | Pascal | 230910T120000Z | Kai Burg |
| 026 | ForWhile | 230804T142844Z | bsoelch |
| 080 | ><> | 131128T151711Z | Cruncher |
| 095 | Rec | 230804T135929Z | D.. |
| 089 | Lua 5.3 | 230419T111803Z | bluswimm |
| 048 | Julia 1.0 | 230307T165248Z | MarcMush |
| 095 | Polyglot | 130823T162133Z | Johannes |
| 012 | Stax | 180221T175053Z | Weijun Z |
| 038 | Zsh | 220310T195654Z | pxeger |
| nan | JSFuck | 220214T223149Z | Kamil Ki |
| 041 | Ly | 210829T062048Z | cnamejj |
| 020 | Pip | 200904T064443Z | Razetime |
| 095 | Brainfuck | 191019T085600Z | Kamila S |
| 043 | Perl 6 | 191017T011120Z | Jo King |
| 086 | Ink | 191015T181650Z | Sara J |
| 051 | Deadfish~ | 190503T143914Z | squid |
| 194 | VTL2 | 190507T124615Z | brhfl |
| 014 | Clam | 190503T150112Z | Mayube |
| 079 | dc | 171019T152315Z | brhfl |
| 056 | Perl 6 | 190414T073046Z | bb94 |
| 060 | Powershell | 181210T131905Z | mazzy |
| 046 | Ruby | 180619T141842Z | G B |
| 065 | Python 3 | 180619T132013Z | Mr. Wize |
| 079 | TSQL | 180618T184443Z | BradC |
| 083 | Z80Golf | 180617T130344Z | lynn |
| 3104 | Memory GAP | 180519T215725Z | Conor O& |
| 080 | PHP | 171018T211556Z | Umbrella |
| 072 | R | 180515T182030Z | ngm |
| 037 | Ruby | 180517T035106Z | Julian K |
| 070 | PHP | 180517T163124Z | Titus |
| 020 | Japt | 180517T005749Z | Bubbler |
| 033 | 05AB1E | 180221T184505Z | Magic Oc |
| 090 | brainfuck | 180221T172059Z | X1M4L |
| 066 | Perl 5 | 180220T085428Z | Dom Hast |
| 088 | Bash pure | 160302T065402Z | Mingye W |
| 035 | ><> | 180111T130231Z | Jo King |
| 369 | Flipbit | 171123T175309Z | caird co |
| 086 | A Pear Tree | 171117T191654Z | MD XF |
| nan | Python 2 | 130824T014246Z | user8777 |
| 024 | J | 150126T220330Z | FUZxxl |
| 096 | JavaScript | 171021T121451Z | user2428 |
| 063 | SmileBASIC | 171019T154646Z | 12Me21 |
| 041 | MATLAB/Octave | 171019T153001Z | Tom Carp |
| 155 | BrainFlak | 171018T184621Z | Riley |
| 126 | brainfuck | 171018T154028Z | KSmarts |
| 024 | RProgN 2 | 171016T020944Z | ATaco |
| 081 | PHP | 171013T001115Z | Calimero |
| 047 | Smalltalk | 171012T232139Z | aka.nice |
| 061 | Cubically | 170805T074157Z | TehPers |
| 111 | Java 111 Bytes | 170802T212201Z | Lord Far |
| 061 | QBIC | 170618T164811Z | steenber |
| 7369 | ISOLADOS | 160908T163810Z | acrolith |
| 066 | Perl6 | 160824T162832Z | bb94 |
| 094 | Lua | 160510T230156Z | Blab |
| 071 | Mathematica | 160510T170548Z | DavidC |
| 052 | Groovy | 141202T065943Z | br2000 |
| 1038 | BitShift | 160509T101106Z | Bassdrop |
| 034 | Pyke | 160509T092312Z | Blue |
| 133 | Bash internals only | 140131T082833Z | ccsalves |
| 069 | Python 2 | 130823T164355Z | miles |
| 095 | Mouse2002 | 151213T140104Z | cat |
| 096 | Javascript/coffeescript/actionscript/more | 151118T233904Z | user4616 |
| 041 | Perl 6 | 151118T183223Z | Brad Gil |
| 078 | Groovy | 151124T194220Z | K. Klass |
| 062 | Python 2 | 140325T010343Z | gcq |
| 086 | ><> | 151119T153245Z | Aaron |
| 111 | Marbelous | 151118T220421Z | Sparr |
| 082 | Microscript II | 151118T203815Z | SuperJed |
| 129 | Hassium | 151016T174422Z | Jacob Mi |
| 075 | PowerShell | 151015T174817Z | AdmBorkB |
| 063 | CBM BASIC v2.0 | 151015T164031Z | Psychona |
| 099 | PHP 99 Characters | 141202T225241Z | Steve Ro |
| 044 | Befunge | 140828T150839Z | proud ha |
| 070 | Haskell | 131003T215746Z | FireFly |
| 057 | Whitespace | 130824T062417Z | DPenner1 |
| 031 | k4 | 140505T185234Z | Aaron Da |
| 043 | Ruby | 140330T130957Z | user4740 |
| 110 | PHP | 140328T091041Z | michal.h |
| nan | 140327T000654Z | ɐɔıʇǝɥʇu | |
| 080 | Bash | 140204T064833Z | Digital |
| 143 | C++ | 140131T173055Z | mattnewp |
| nan | I know it's not winning any contests. I just wanted to try it in a language not normally used | 130824T005046Z | asteri |
| 047 | sh | 131003T144953Z | FireFly |
| 103 | Clojure 142 | 140130T185611Z | RedDeckW |
| 078 | Javascript | 140131T143719Z | Gaurang |
| 077 | Python | 140131T104922Z | Taku |
| 110 | Brainfuck | 140130T111957Z | FIQ |
| 069 | C | 130825T074938Z | breadbox |
| nan | 140130T190735Z | ahuth | |
| 094 | Javascript | 140130T193114Z | mattnewp |
| 126 | Java | 140130T192536Z | ICR |
| 066 | F# | 140130T173248Z | mattnewp |
| 088 | JavaScript | 131128T144046Z | xem |
| nan | JavaScript 96 bytes long | 131128T123610Z | xem |
| 094 | Python | 131127T220927Z | Timtech |
| 096 | PowerShell | 131123T062652Z | Iszi |
| 044 | Q | 131023T152428Z | tmartin |
| 050 | Ruby | 131003T211616Z | biinari |
| nan | Not very serious | 131003T200249Z | Qqwy |
| 048 | Befunge | 131003T183055Z | FireFly |
| 092 | Javascript | 131002T094342Z | C5H8NNaO |
| 021 | J | 131002T091800Z | jpjacobs |
| 057 | Ruby | 130823T165127Z | Doorknob |
| nan | Definitely the longest solution here | 130824T194244Z | gronosta |
| 173 | Brainfuck | 130825T114255Z | copy |
| 061 | Python 3 68 | 130823T191240Z | user8943 |
| 049 | Perl | 130824T060908Z | breadbox |
| 012 | GolfScript | 130823T194915Z | Howard |
| 016 | GolfScript | 130823T190346Z | Peter Ta |
| 2624 | Golfscript | 130823T172333Z | John Dvo |
| 040 | J | 130823T161107Z | marinus |
tinylisp, 95 bytes
(d !"#$%&'*+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bcefghijklmnoprstuvwxyz{|}~ q)(a 652 437
Output:
1089
My starting point was this (boring) solution which is 96 bytes:
(d !"#$%&'*+,-./123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcefghijklmnopqrstuvwxyz{|}~ 0)
A bit of googling led me to this equality: 652 + 437 = 1089, and I managed to use that to shave off one byte.
Japt, 13 bytes
Bah! Stoopid k and its stoopid case-insensitivity costing me 2 bytes!
;EkQ+"+QkE;"E
;EkQ+"+QkE;"E
;E :ASCII
k :Remove characters contained in the following string
Q : Quotation mark
+"+QkE;" : Append literal string
E : Irrelevant truthy second argument for k to make it case insensitive.
Vyxal, 11 bytes
I don't think I saw any Vyxal on here! Prints all printable ASCII with kQ and filters chars out with F
kQ`\kQF\``F
PHP 5.2, 4 + 69
<?<<
Save as a file called !"#$%&'()*+-.023456789;=>@ABCDEFGIJKMNOQRUVWXYZ[\]^`bfghjkmqvwz{|}~. short_open_tag needs to be On in your php.ini.
The output is:
PHP Parse error: syntax error, unexpected T_SL in /wherever/!"#$%&\'()*+-.023456789;=>@ABCDEFGIJKMNOQRUVWXYZ[\\]^`bfghjkmqvwz{|}~ on line 1
Pascal, 198 B
The Pascal programming language does not prescribe any particular character encoding (e. g. ASCII).
Pascal only requires that the implementation-defined character set includes characters necessary to write Pascal source code.
Thus e. g. the existence of ~ is not guaranteed as such character is not necessary to successfully write Pascal source code.
Therefore this submission does not restrict the output to the chr(32) – chr(126) range, because there is no assertion that chr(32) = ' ' or chr(126) ≤ maxChar.
The implementation-defined constant maxChar is available in any processor compliant with ISO standard 10206 “Extended Pascal” and denotes the largest available value of the built‑in char data type.
PROGRAM P(OUTPUT);VAR C:CHAR;BEGIN FOR C IN[CHR(0)..MAXCHAR]-[' ','-',';',':','.','''','(',')','[',']','0','A','B','C','D','E','F','G','H','I','M','N','O','P','R','T','U','V','W','X']DO WRITE(C)END.
The for … in set member iteration statement and range-based set constructor (e. g. [1..3] = [1, 2, 3]) are defined by ISO standard 10206 “Extended Pascal”.
The particular order the char values are printed is implementation-dependent.
You may alter the casing of letters in any way you like (subject to availability, i. e. it is not guaranteed that lower and uppercase letters coexist).
147 B:
Some submissions use the source code file as input.
In Pascal the availability of the source code file during execution time is not guaranteed.
You can of course feed back the source code file as input to the program, but technically this outputs the characters not present in input:
program p(input,output);var c:char;m:set of char;begin m:=[];while not EOF do begin read(c);m:=m+[c]end;for c in[chr(0)..maxChar]-m do write(c)end.
ForWhile, 26 bytes
!$%&'*,-./012348 69(57+#)"
uses the first 26 printable Ascii characters, prints the remaining 69 characters
~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:
Explanation
!$%&'*,-./012348 \ operations without observable side effects
69(57+#) \ print ascii characters ':' to '~'
" \ start a string literal
\ for-while ignores unclosed strings at end of file
><> - 80
zbcdjkpqruvwxaABCDEFGHIJKLMNOPQRSTUVWXYZ#!"'$%^&*()@!+-[]{},;:/\<>=?|~0123456789
When fish errors it prints out "something smells fishy...". Since z is a bad instruction it errors right away
Rec, 95 bytes
[0^ !"#$%&'()*+,-./123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\_`abcdefghijklmnopqrstuvwxyz{|}~]
Lua 5.3, 89 bytes
print(_VERSION)--!"#$%&'*+,/01246789:;<=>?@ABCDFGHJKMPQTUWXYZ[\]^`bcdefghjklmoqsvwxyz{|}~
Prints Lua 5.3. Same principle can be applied to other versions, though you may need to add a byte or two depending on the version.
Polyglot, 95
#undef X;A!"$%&'()*+-[,.]/0123456789:<=>?@BCDEFGHIJKLMNOPQRSTUVWYZ\^_`abcghijklmopqrstvwxyz{|}~
- Perl
- Perl 6
- Any *nx-like shell (
tclsh,bash,sh,ksh, etc) - Awk (GNU / POSIX)
- Brainfuck, Brian & Chuck, other derivatives
- Ruby
- Coffescript
- Golfscript
- Python
- R
- Julia
- Whitespace
- rk
- Gaot++
- bc
- jq
- Joy
- Tcl
- 99
- V (FMota)
- Acc!!
- C - if no
main()is needed. Thanks to urogen - Duocentehexaquinquagesimal
- Vyxal
O - Thunno
d - Probably more.
Does nothing.
Stax, 12 bytes
Vp.."-"Vp-"-
Added for completeness.
Vp in Stax is the set of all printable ASCII characters, .." is the two character string literal (of .") in Stax.
JSFuck 11863
This answer is a compressed version of this code
for(x=0x7e;x>0x19;x--){console.log(String.fromCharCode(x).replace(/[\[\]!\+\(\)]/ig,''))}
here is the full working JSFuck version of this code
[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(+(!+[]+!+[]+!+[]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+!+[]+[!+[]+!+[]])+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]])()([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]]+((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]]+[!+[]+!+[]+!+[]+!+[]]+(!![]+[])[+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+(!![]+[])[+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+(!![]+[])[+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[+!+[]]+(!![]+[])[+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[+!+[]]+(!![]+[])[+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]])[(![]+[])[!+[]+!+[]+!+[]]+(+(!+[]+!+[]+[+!+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+!+[]+[+!+[]])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]]((!![]+[])[+[]])[([][(!![]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]](([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])+[])[+!+[]])+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]])())
Ly, 41 bytes
"lops!;=`][' "s'"ll[p'~=[;]p~![!lo]pl`sl]
This one just pushes all the unique characters used in the code (minus ~ to the stack, along with ") then iterates from the codepoint for (space) checking to see if that codepoint is on the stack. Any codepoint that isn't found is printed.
"lops!;=`][' " - loads all the used chars to the stack
s - save ` ` (space) to backup cell
'" - add `"` to the stack too
ll - load the curr codepoint twice
[p l] - infinite loop
'~=[;]p - if the code point is `~` exit
~ - search stack for curr codepoint
! - negate results boolean
[! ]p - if/then, true if not found
lo - restore curr codepoint and print
l`s - restore curr codepoint and increment
Output is:
#$%&()*+,-./0123456789<>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\^_abcdefghijkmnqrtuvwxyz{|}
Pip, 20 bytes
PARM`[\\APRM\`\]\[]`
Uses the predefined printable ASCII variable, and regexes out the letters in the code.
Brainfuck, 95 bytes
[ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\^_`abcdefghijklmnopqrstuvwxyz{|}~]
The way this works is pretty simple, any decent Brainfuck interpreter will ignore the code between the brackets appearing at the start of source file, therefore creating a comment.
Ink, 91 86 bytes
{POW(77,7)} /*-#!"$%&'9:;<=>?@ABCDFGHIJKLMNQRSTUVXYZ[\]^_`abcdefghijklmnopqrstuvwxyz|~
Prints 1.604852E+13
The only thing Ink can really do to a string is print it - if you want to do actual string processing, you're meant to hook into external code. This means almost all characters will have to occur in our code, since we generally have no way to print the ones that don't. That means we can basically treat the first occurrence of each character as being free, and see how much stuff we can generate with as few repeated characters as possible.
One thing Ink can do is math. We can generate and print a number. With only two repeated characters, the expression {POW(77,7)} becomes 1.604852E+13, which has eleven distinct characters, none of which are used in the expression.
At this point, there isn't much more we could generate. We need 7 in our code, and while we might be able to generate a -, we'd need another set of {} to do more math, so that would really be a net negative. So we begin a multi-line comment using /* (because Ink doesn't care if we ever close those) and shove all the rest of the characters we aren't using in there.
-5 bytesby creating a larger floating-point number usingPOWinstead ofFLOAT, which then also includesEand+and has fewer repeated characters
Deadfish~, 70 55 51 bytes
{iii}i{icicicicicic}dd{ci}iicicicici{ic}dd{ci}iciic
Because, y'know, I'm hilarious and original.
Saved 15 bytes by repeating a few characters
Saved 4 more by simplifying both instances of d{ic}i to {ci}
Previous Version (55 bytes):
{iii}i{icicicicicic}ddd{ic}iiicicicici{ic}ddd{ic}iiciic
VTL-2, 194 bytes
33 ~=#-1
51 ~=~+1
53 #=51*((~=35)+(~=(35+1))+(~=(35+5))+(~=(35+5+1))+(~=(35+5+1+1))
55 #=51*((~=(35+5+3))+(~=(35+5+5))+(~=(51-1-1))+(~=51)+(~=53)
111 #=51*(55+5+1=~
113 $=~
115 #=51*(1-(~=(115+5+5
Prints !"%&',./0246789:;<>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}. It's about double the length of the comment approach, but much more interesting. I had to use some digits, and restricting it to 1, 3, and 5 seemed to work the best... though I haven't proven this. Line-by-line explanation:
33: Assigns the variable ~ to the current line number (#) less 1. Originally I was going to use ! and be able to start printing from 34 on, but... ! is a system variable.
51: Increments the value in ~
53, 55, 111: These all basically say IF ~ == 35 OR ~ == 36 OR ~ == 40 [...] GOTO 51. VTL relies heavily on system variables. # is the line number variable - as in line 33, we can pull the value of the current line number, but if we assign a value to #, it's a GOTO. The initial #= is this assignment, everything else is evaluation. Any given ~=35 type evaluation returns one for true (equality) or zero otherwise. We do as many of these as fit in a line (72 characters), sum them, and multiply this by our target line number. If any of those evaluations were true, we end up with #=51; if not, we end up with #=0, essentially a NOP.
113: Output character corresponding to code point.
115: Same sort of GOTO construction as above, except we're looping back IF ~ != 125. So, first we have to see if ~ does equal 125, then subtract that from 1 to make it a NOT.
Keeping in mind the line length restrictions, the lazy commented version comes in at 93 bytes:
12340 )"#$%&'(*+,-./:;<=>?ABCDEFGHIJKLMNOPQRSTU!
56789 )VWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~@
...although I can't actually enter this because the @ chokes it. And now I know why: "At any time before hitting Return, the entire line may be erased by typing the At-signcharacter ‘@’ (Shift-P or “Cancel” on some terminals.)". So the non-printing commented version is purely theoretical, and some code would have to be written to at least print the @... which would mean code to print the characters used in that code, etc...
Clam, 14 bytes
pE'a-"pE'a-\""
Just performs a diff between all printable ASCII character and the few unique chars in this program.
Explanation
pE'a-"pE'a-\""
p - Print...
'a- - Printable ASCII range
E - That isn't found in...
"pE'a-\"" - The characters used in this program
dc, 83 79 bytes
120d115 108 100 93 91 80 62[d1-d43<:]ds:x[l.dP]s;34s.[dl.!=;s,l.1+ds.127>/]ds/x
Prints "#$%&'()*?@ABCDEFGHIJKLMNOQRSTUVWXYZ\^_`abcefghijkmnopqrtuvwyz{|}~
The lazy answer of commenting out the entire printable range (and printing nothing) would be 95 bytes, so while this may be suboptimal, I'm pretty pleased.
120d115 108 100 93 91 80 62[d1-d43<:]ds:x puts all the values on the stack that we need to ignore. Decimal is seemingly the ideal base for this, particularly when I factor in the additional characters that would be needed to change the input base. The first few values I have to enter in manually, but I use all the characters from 43-62, so I can generate those in a loop. I don't need to use a few of these characters, but it saves bytes to run through the ones that I don't need, so I named my registers/macros :, ., ,, ;, and / for the sake of using those characters.
[l.dP]s; is the macro that will print the character if it's not in the list. 34s. is the counter - since I use characters 32 and 33, I just start at 34. [dl.!=;s,l.1+ds.127>/]ds/x is a pretty straightforward macro, just load the counter, ., see if it's in the list, run ; if so, increment, and loop until we're out of printable range.
Golfed off four bytes because I was accidentally omitting p (this also made my answer invalid!). I must have at one point used both P and p to print, or thought I would have to.
Powershell, 60 bytes
Inspired by Iszi's answer. See also AdmBorkBork's answer with another approach.
$t=gc(gv My* -v|% I*e)|% t*y
[char[]](32..126)|?{$_-notin$t}
where:
gv My* -vis alias and shortcut forGet-Variable MyInvocation -Value.|% I*eis shortcut for|% InvocationName.|% t*yis shortcut for|% ToCharArray.- and first line means: store to the variable
$ta char array that is read from a file with a name that is taken from the properties of the current script.
Python 3, 65
print(''.join(set(map(chr,range(32,127)))-set(open('q').read())))
Name the file 'q'. Run with python3 q. If 'q' is an unacceptable filename the file can be named '.py' for an additional 2 characters.
T-SQL, 79 bytes:
PRint upper('abcdefghijlkmnoqstuvwxyz')--!"#$%&*+,./0123456789:;<=>?@[\]^_`{|}~
Kinda cheaty, everything after -- is a comment.
Less cheaty, much longer (143 bytes):
WITH UX AS(SELECT 33D union ALL SELECT D+1FROM UX WHERE D<126)
select CHAR(D)from UX where charindex(char(D),'acdefhilmnorstuwx()+<,''=01236')=0
Must be run on a case-insensitive database. This uses a recursive number table to generate values from 33 to 126, and displays the CHAR() of each, excluding any that are in a string (that simply re-lists all characters used elsewhere in the code).
SQL keywords are not case-sensitive, so I vary the case to cover both upper and lower of each letter used. CHARINDEX on a case-insensitive database then excludes both the upper and lower of each in the string, saving me some characters.
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 {|}
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
add hl,hl
add hl,hl
add hl,hl
add hl,hl
add hl,hl
add hl,hl
add hl,hl
add hl,hl
add hl,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.
Memory GAP, 3104 bytes
74b87337454200d4d33f80c4663dc5e5f7bd60b75b29d79b660a2859395c1a240e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf47cef8a734855777c2a9d0caf42666e69b21afc54fb48d153c19101658f4a2a480e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf4594f803b380a41396ed63dca39503542f7bd60b75b29d79b660a2859395c1a240e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a092433247bce5c74f589f4867dbd57e9ca9f808f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4594f803b380a41396ed63dca395035420e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a0924332f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a09243320cc175b9c0f1b6a831c399e269772661f7bd60b75b29d79b660a2859395c1a24f24c2c15b9d03797c6874986a8d1951634ec78fcc91ffb1e54cd85e4a0924332faf05c15dfad45dafd1fc23d51236853f0a1dfdc675b0a14a64099f7ac1cee8374b87337454200d4d33f80c4663dc5e5f7bd60b75b29d79b660a2859395c1a240e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e54cd85e4a09243320cc175b9c0f1b6a831c399e269772661f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4594f803b380a41396ed63dca39503542f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a0924332faf05c15dfad45dafd1fc23d5123685334ec78fcc91ffb1e54cd85e4a09243320cc175b9c0f1b6a831c399e269772661f7bd60b75b29d79b660a2859395c1a24f0a1dfdc675b0a14a64099f7ac1cee83f24c2c15b9d03797c6874986a8d1951634ec78fcc91ffb1e54cd85e4a09243327cef8a734855777c2a9d0caf42666e69b21afc54fb48d153c19101658f4a2a48a87deb01c5f539e6bda34829c8ef2368c68271a63ddbc431c307beb7d2918275852438d026c018c4307b916406f98c6274985f5115ad149212a917dbef8ec801b21afc54fb48d153c19101658f4a2a480cc175b9c0f1b6a831c399e269772661f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf474b87337454200d4d33f80c4663dc5e5f7bd60b75b29d79b660a2859395c1a240e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243324124bc0a9335c27f086f24ba207a4912f7bd60b75b29d79b660a2859395c1a24f24c2c15b9d03797c6874986a8d1951634ec78fcc91ffb1e54cd85e4a0924332faf05c15dfad45dafd1fc23d5123685374985f5115ad149212a917dbef8ec801
Expanded:
74b87337454200d4d33f80c4663dc5e5f7bd60b75b29d79b660a2859395c1a240e9f1e8e40bb79e8
00b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4
34ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e
54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf47cef8a734855777c2a9d0caf42666e69
b21afc54fb48d153c19101658f4a2a480e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e8
00b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf4594f803b380a41396ed63dca39503542
f7bd60b75b29d79b660a2859395c1a240e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e8
00b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e800b0cc9433830cf4
34ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e
54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a0924332
47bce5c74f589f4867dbd57e9ca9f808f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e
54cd85e4a092433234ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4
594f803b380a41396ed63dca395035420e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e
54cd85e4a0924332f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a0924332
0cc175b9c0f1b6a831c399e269772661f7bd60b75b29d79b660a2859395c1a24f24c2c15b9d03797
c6874986a8d1951634ec78fcc91ffb1e54cd85e4a0924332faf05c15dfad45dafd1fc23d51236853
f0a1dfdc675b0a14a64099f7ac1cee8374b87337454200d4d33f80c4663dc5e5f7bd60b75b29d79b
660a2859395c1a240e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a0924332
0e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e8
00b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4
0e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a092433234ec78fcc91ffb1e
54cd85e4a09243320cc175b9c0f1b6a831c399e269772661f7bd60b75b29d79b660a2859395c1a24
34ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4594f803b380a4139
6ed63dca39503542f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a0924332
faf05c15dfad45dafd1fc23d5123685334ec78fcc91ffb1e54cd85e4a09243320cc175b9c0f1b6a8
31c399e269772661f7bd60b75b29d79b660a2859395c1a24f0a1dfdc675b0a14a64099f7ac1cee83
f24c2c15b9d03797c6874986a8d1951634ec78fcc91ffb1e54cd85e4a09243327cef8a734855777c
2a9d0caf42666e69b21afc54fb48d153c19101658f4a2a48a87deb01c5f539e6bda34829c8ef2368
c68271a63ddbc431c307beb7d2918275852438d026c018c4307b916406f98c6274985f5115ad1492
12a917dbef8ec801b21afc54fb48d153c19101658f4a2a480cc175b9c0f1b6a831c399e269772661
f7bd60b75b29d79b660a2859395c1a2434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e8
00b0cc9433830cf474b87337454200d4d33f80c4663dc5e5f7bd60b75b29d79b660a2859395c1a24
0e9f1e8e40bb79e800b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e8
00b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4
34ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf40e9f1e8e40bb79e8
00b0cc9433830cf434ec78fcc91ffb1e54cd85e4a09243320e9f1e8e40bb79e800b0cc9433830cf4
34ec78fcc91ffb1e54cd85e4a09243324124bc0a9335c27f086f24ba207a4912f7bd60b75b29d79b
660a2859395c1a24f24c2c15b9d03797c6874986a8d1951634ec78fcc91ffb1e54cd85e4a0924332
faf05c15dfad45dafd1fc23d5123685374985f5115ad149212a917dbef8ec801
Explanation
Memory GAP's instructions are md5 hashes of their actual instructions. Using ; as a delimiter, this is the "original" program:
;
aaaa;size;dup;add;dup;add;dup;add;
dup;open;pop;
dup;
dup;
dup;
aaaaa;size;dup;dup;dup;dup;add;add;add;dup;add;aaa;size;add;add;dup;aaaaa;dup;add;size;add;a;size;neg;add;
btwn;
swap;
aaaa;size;dup;add;dup;add;dup;add;dup;dup;add;add;a;size;add;dup;aaaaa;size;add;btwn;
add;
a;size;swap;neg;add;
open;
pop;char;out;nil;shut;pop;
a;size;add;
dup;
aaaa;size;dup;add;dup;add;dup;add;
dup;dup;add;dup;add;aa;size;neg;add;btwn;
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'.
PHP, 80
Compliant with current rules, I think, no loopholes anyway
<?=join(array_diff(range(' ','~'),str_split(' \'(),;<=?\_acdefghijlnoprsty~')));
Just gets the difference between the full set and the chars I used.
Self Tests like this, if first and second line of output match, the first line is a valid solution
<?=join(array_diff(range(' ','~'),str_split(' \'(),;<=?\_acdefghijlnoprsty~')));
$used = count_chars(file(__FILE__)[0],3);
$ascii = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
$unused = str_replace(str_split($used), '', $ascii);
echo "\n".$unused;
echo "\n".$used;
echo "\n";
R, 72 bytes
cat(intToUtf8(setdiff(32:126,utf8ToInt("\\\"(),12368:ITUacdefinostu"))))
With correction from @JayCe
Ruby, 46, 37
puts (?!..?~).to_a-IO.read($0).chars
Creates a range of characters from ! to ~, reads the current file and subtracts the characters in the current file from the range, then prints them all out.
Inspiration from prior Ruby post of Doorknob.
PHP, 70 bytes
for($c=31;++$c<127;)count_chars(file(__FILE__)[0])[$c]||print chr($c);
PHP, 80 bytes
<?=join(array_diff(range(" ","~"),str_split(count_chars(file(__FILE__)[0],3))));
Require PHP 5.4 or later (released 2012-03-01) for indexing the function result.
Japt, 20 bytes
#[o_d#$ k"[o_d$k1!"1
How it works
#[o_d#$ k"[o_d$k1!"1
#[o Map range(91) with...
_d#$ Apply chr(n+36)...
k"[o_d$k1!" and remove these chars from it...
1 in case sensitive mode.
Implicit output (result is Array; comma-joined)
Dealing with the quotes turned out to be nasty, so I reduced the range to start at $ (36) instead of (32).
05AB1E, 33 bytes
157 255B'QJ.V"157 2B'QJ.VSK"SK'"K
Pushes žQ by converting 157 into base 255.
Executes žQ with .V which pushes the printable ASCII character set (32-128).
Then remove all characters in the source code using K.
brainfuck, 90 bytes
++++[->+++>++++++++<<]>-[->.>+<+<]>+.+++>++[-<.<++>+>]<+.++<++[->.>+<+<]>+.++>+++++[-<.+>]
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{|}~
Bash (pure), 93 92 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)
Explanation
- The
evalthing: 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 setIFSproperly, andreadby default will consume\x20,\nand\t. The\x20part 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....
><>, 44 43 37 35 bytes
crossed out 44 is still regular 44 ;(
" 'r:{-}30{l4-*?.~~:9e*=?;:l2=?o1+}
Outputs !#$%&(),/5678<>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdfghijkmnpqstuvwxyz|
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
Flipbit, 369 bytes
^>>>>>.^.^<^>.^.^<^<^>>.^.^<^>.^.^<^<^<^>>>.^.^<^>.^.^<^<^>>.^.<^>.>^<[^<]^>>>>.^.^<^>.^.^<^<^>>.^.^<^>.^.^<^<^<^>>>.^.^<^>.^.<^<^>>.<^>.<<<<^>^>^>^>^>.^.<^>.^.^<^<^>>.^.^<^>.^.^<^<^<^>>>.^.^<^>.^.^<^<^>>.^.^<^>.^.<<<<^>>>>.<^>.^.<<^>^>^.^.<^>.^.<<<^>>>.^.<^>.^.<<^>^>.<^>.^.<^>.<<^<<^<^>>>>>.^.<^>.^.<<^>>.^.<^>.^.^<<^<^>>>.^.<^>.^.<<^>>.^.<^>.^.<^>[^<].<<<<^>>>^.<^>.
Assumes that the output can contain characters outside the ASCII range, so here is a hexdump:
00000000: 2021 2223 2425 2627 2829 2a2b 2c2d 2f30 !"#$%&'()*+,-/0
00000010: 3132 3334 3536 3738 393a 3b3d 3f41 4042 123456789:;=?A@B
00000020: 4344 4546 4748 494a 4b4c 4d4e 4f5f 5d5c CDEFGHIJKLMNO_]\
00000030: 5b5a 5859 5150 5253 5557 5654 6061 6362 [ZXYQPRSUWVT`acb
00000040: 6667 6564 6968 6a6b 6f6e 6c6d 7071 7273 fgedihjkonlmpqrs
00000050: 7475 7677 7879 7a7b 7d7f c0c1 c3c2 c5c4 tuvwxyz{}.......
00000060: c7c6 c9c8 cbca cdcc cfce dedc ddda dbd9 ................
00000070: d8d0 d1d3 d2d4 d6d7 d5e1 e0e2 e3e7 e6e4 ................
00000080: e5e8 e9eb eaee efed ec7e 7c .........~|
Don't you dare ask me how it works. As this (ab)used a bug which has no been fixed, test with this commit.
A Pear Tree, 86 bytes
`~1!2@3#4$5%6^7&8*9(0)-_=+[]{}\|;':",./<>?bcfhjklmnoqsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
It appears the only error message is "a partridge".
Python 2, 68 83 88 (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.
J, 24 bytes
Another J solution in 24 characters:
'''{a.239-'-.~93{.32}.a.
a.is the alphabet, this is, character 0 to 255 where some characters are replaced with box-drawing characters.32}.a.drops the first 32 characters ofa.(the box-drawing and control characters)93{.32}.a.takes the first 93 characters of what remains. That is, ASCII characters 32 to 126. We don't take the tilde~or the closing curly brace}because they are part of the program.'''{a.239-'-.~94{.32}.a.removes the set of the characters'{.a239-(the remaining ASCII characters that are part of the program) from the character set generated in the previous step, yielding all ASCII characters that are not part of this program.
JavaScript, 96
eval(l="for(e=32,x='';e<127;e++)v=eval('\"\\\\x'+e.toString(16)+'\"'),x+=-1==l.indexOf(v)?v:''")
SmileBASIC, 78 63 bytes
FOR I=32TO 126?CHR$(I)*(INSTR(LOAD("TXT:_",0),CHR$(I))<0);
NEXT
Assumes the program is saved in a file named _ (which sounds like cheating to me but apparently this is ok)
Brain-Flak, 155 bytes
Includes +1 for -A
((((((()()()()){}){}){})<>[()()()])[()])((((()()()){})){}{})<>((()()()()){}){({}[()]<(({})())>)}{}({}()())<>{{({}<>[()]<(({})())><>)}{}<>(({}())()())<>}<>
# Push 32 on this stack and 18, 28 and 29 to the other
# 18, 28 and 29 are the distances between the sets of braces
((((((()()()()){}){}){})<>[()()()])[()])((((()()()){})){}{})<>
# For 0 to 8
((()()()()){}){({}[()]<
# Push TOS, TOS + 1
(({})())
# end For 0 to 8
>)}{}
# Push TOS + 2
# skips '(' and ')'
({}()())
# For each value on the off stack (18, 28, 28)
<>{
# For 0 to that number
{({}<>[()]<
# Push TOS, TOS + 1
(({})())
# End for 0 to that number
><>)}{}
# Push TOS + 1, TOS + 3 (skips this set of braces)
<>(({}())()())<>
# End for each value on the off stack (18, 28, 28)
}<>
brainfuck, 126 bytes
The polyglot that lists all the printable ASCII characters and prints nothing is shorter, but this uses only valid brainfuck commands and prints the rest.
>+[-->---[-<]>]>+>++++++++++[<.+>-]+++++++++++++<+.+++>[<.+>-]>++++[<+++++++>-]<<+.++>[<.+>-]>++++[<++++++++>-]<+<+.++>[<.+>-]
PHP, 81 bytes
<?php $w=file(__FILE__)[0];foreach(range(' ','')as$i){echo!strpos($w,$i)?$i:'';}
Shortest by-the-book PHP submission so far, built upon @michal.hubczyk 's answer with a few golf twists. Interestingly enough, adding the <?php prolog saves some bytes off the whole solution, thanks to the use of file()[0] modern php array-dereferencing on the one-liner file instead of the classic file_get_contents().
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 charactersthisContext sourceCodeproduces a decompileString of the snippetdifference: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 withDoIt ^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)
Cubically, 61 bytes
Code:
~:5+1-777(B1D1+7)6+33077777(D3B3@6-7)0&2 !"#$%'*,./489;<=>?AC
Unique characters in program:
!"#$%&'()*+,-./0123456789:;<=>?@ABCD~
Output:
EFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}
Java - 111 Bytes
I know I'm 4 years too late, but I just found this question.
void SPARE_VOMIT(){System.out.print(0!=('^'>>8|3&6%2<<~7*4)?"$#/^@\bc[]":'`'-5+"lnbfghjkqwxyz".toUpperCase());}
I tried to put as few characters in the ignored String as possible.
Ungolfed:
void SPARE_VOMIT(){ // vomit out all the spare characters
System.out.print(0 != ('^'>>8|3&6%2<<~7*4) ? // Both sides here = 0
"$#/^@\bc[]" : // The shame string...
'`'-5 + "lnbfghjkqwxyz".toUpperCase()); // Print 91 and caps.
}
QBIC, 61 bytes
[32,126|B=chr$(a)~instr(A,B)|\?B}##$(),1236=?ABB[\achinrst|}~
Are we allowing new languages on old challenges yet?
Explanation
[32,126| FOR a = 32 TO 126
B=chr$(a) Set B$ to the char code a
~instr(A,B) IF A$ contains B$
| THEN do nothing
\?B} ELSE print B$
# Define a literal A$ that has every char in this program once.
#$(),1236=?ABB[\achinrst|}~
Usually, QBIC would delimit a literal with a backtck ('`'), so that's the one char we can't have in a literal. However, the backtick is auto-added on open literals at EOF.
ISOLADOS, 7369 bytes (non-competing)
ISOLAADOOS ISOLAAAAAAADOS ISOLAADOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOO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AADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS
Perl6, 66
(63..96)>>.chr.join.print #!"$%&/+-*:;<=0124578abdefghklmqsuvwxyz'
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.
Mathematica 71 bytes
Taking as the range of "printable" characters ASCII 32-126, this takes the complement of the full set of characters (CharacterRange[32, 126]) and the used set of characters ("Charactes@Rngplm[32,16]").
Complement[CharacterRange[32, 126],Characters@"Charactes@Rngplm[32,16]"]
{"!", "#", "%", "^", "&", "*", "(", ")", "_", "-", "+", "=", "~", "`", "{", "}", "|", "\", "<", ">", ".", ";", "\"", "?", "'", "/", ":", " ", "0", "4", "5", "7", "8", "9", "A", "b", "B", "d", "D", "E", "f", "F", "G", "H", "i", "I", "j", "J", "k", "K", "L", "M", "N", "o", "O", "P", "q", "Q", "S", "T", "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z", "$"}
Groovy: 52 chars
print(((' '..'~')-new File('a').text.grep()).join())
// print all characters from '#' to '~', except those present in the file itself (the name of the source file is 'a').
BitShift, 1038 bytes
BitShift is a language which only supports 0 and 1 as syntax. I figured it would be easy to print all other characters, but since it doesn't really support looping it still ended up a massive 1038 bytes.
However, I believe it's not really possible to go any smaller than this..
101001100101011011010100110111010100100101011001101111010100100101011001000101011011010100101100110110101001001010110010001010110110101000001101010010010101100100010101101101010000010000011001010110110101000010000101011011010100110111010100100101011111100101011011010100110111010100100101011001101111010100100101011001000101011011010100000000011010100100101011001000101011011010100110010000101011011010100110111010100100101011001101001101010010010101100100010101101101010011001000010101101101010011011101010010010101111011111110010101101101010011011101010010010101100101100101011011010100010001010110110101001000010101101101010011011101010010010101110111110010101101101010011011101010010010101111111100101011011010100110111010100100101011111011110101001001010110010001010110110101001000100000101011011010100110111010100100101011111010011010100100101011001000101011011010100100000101011011010100110111010100100101011001101111010100100101011001000101011011010100010000010101101101010011011101010010010101101001101101010010010101101001101010
Prints
!"#$%&'()*+,-./23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
Try it here
Pyke, 34 bytes, noncompeting
"!$%&'()*+[,.]/:<=>?@^_`{|}";~J\J-
I'm going the no-op, print chars route
Bash internals only, 133 bytes
w=printf
while IFS= read -r -n1 r;do i[$($w %d \'$r)]=1;done<$0
for r in {33..126};do [[ 1 -ne ${i[$r]} ]]&& $w \\$($w "%o" $r);done
Save and run with bash <filename>
Explanation
- Make
printfshorter. - For each char
rread from$0(i.e. the script itself), seti[ord(r)]to 1. - For each number
rinrange(33, 127), ifi[r]is not1,printfthe char corresponding to the numberr. The$w \\$($w "%o" $r)part is where the number-to-char magic is: convert the number to OCT, and then prepend a backslash, and finally feed toprintfto really print it.
The output is in ASCII order.
Python 2, 69
for x in range(38):print chr(x+59)#!"$%&'*,-./012467bdjklmqsuvwyz{|}~
I use the longest (that I'm able to find) sequence of continuous chars I can print out and add the others as a comment after the code.
Mouse-2002, 105 95
$!"#%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
Contains a bunch of unprintables; hexdump (reversible with xxd -r):
Does nothing, and is not a comment; it just so happens everything after $ is ignored.
A real answer would start like
zh+i:(i.127<^i.!'i.b+i:)
But you'd need a lot of if-statements and it would just get ridiculously long.
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!)
Perl 6, 41 bytes
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.
Groovy, 90 78 bytes
(32..126).each{print'(32.16)each{print\'\\dxOf+?:}'.indexOf(it)+1?'':(char)it}
Python 2, 62
from string import*;print set(printable)-set(open("p").read())
Code must be saved in a file called p.
Lowest python solution so far ;D
><>, 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.
Marbelous, 111 bytes
@0
--7E
<XE\
../\@0
:E\
}0}0
&0&1
{0{>
}0
-F
-E
-5
-4
>0
-7
>D
-F
>0
-2
>0
-2
>0
-3
>3
-2
-6
-8
-9
>0
&0&1
\/\/
Main board loops from 0x7E down to 0x20, E\ function rejects values by decrementing and comparing to small numbers (Marbelous' built in < and > operators only work on the range 0-35).
Microscript II, 82 bytes
Well, that's just ridiculous.
( %&'*+,-./12345789:<=>?@ABCDEFGHIJKLMNORSTUVWXYZ\^_`bcdghijkmovwxyz{|}~)P6;q!p#Q$
One ridiculously long unexecuted conditional, followed by the commands P6;q!p#Q$.
Output:
null
"false"true"0"
[]
Hassium, 129 Bytes
This one is a bit more unique than some of what I've seen. It reads the program's source into a variable then iterates of the ASCII table.
To run you must save your code in a file called "f".
use IO;func main(){f=File.readText("f");for(c=0;c<128;c++){c=Convert.toChar(c);g=1;foreach(d in f)if(c==d)g=0;if(g==1)print(c);}}
Run and see expanded here
PowerShell, 75 bytes
[char[]](32..39+42+44+45+47+58..90+92+94..96+98+100..103+105..113+115..126)
A different approach than the other PowerShell answer. Here, we manually build a list of ASCII values (...) that aren't in the source code, then cast that as a char-array [char[]]. PowerShell will by default write out values alone on a line like this, so we get printing for free.
Characters used in code: ()+.0123456789[]achr
CBM BASIC v2.0 - 63
0fori=84+5to127.
3?chr$(i);:next
6rem "!#%&'*,-/<>@abdgjklmpqsuvw
PHP - 99 Characters
echo implode('',array_diff(array_map('chr',range(33,126)),str_split(file_get_contents(__FILE__))));
Befunge, 44 characters
tested in http://www.bedroomlan.org/tools/befunge-93-playground
$#~"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
Haskell (70)
import Data.List
main=putStrLn$[' '..'~']\\" \\\"$'.=DLS[]aimnoprstu~"
The boring duplicate-characters-in-program-in-a-string, subtract-from-universal-set solution. Far from a codegolf winner, though it's surprisingly legible for its length.
(Now with list subtraction instead of filter/notWith.)
Whitespace, 61 57 characters
It's not the shortest but it probably has the simplest logic (it's just a loop really).
Here it is completely commented, where S is space, T is tab, L is line feed:
SSSTSSSSSL # push 0x20
LSSSL # label S
SSSTL # push 1
TSSS # add
SLS # duplicate top of stack
SLS # duplicate again
TLSS # output ASCII character
SSSTTTTTTSL # push 0x7E
TSST # subtract (result - 0x7E)
LTTSL # branch to label S if top of stack is negative
LLL # end
Thanks to @r.e.s. for correction to the above (required extra duplicate for the branch instruction) and for smaller numbers to push on the stack.
k4 (31)
-1 x@&~(x:"c"$32+!95)in*0:.z.f;
save in a file, name doesn't matter (except that the extension has to be .k), and run with q.
$ q aq.k 2>/dev/null
#%',/4678<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abdeghjklmopqrstuvwy{|}
works by getting the name of current script file, reading it, removing its contents from the list of all printable ascii, and printing what's left.
if we dispense with the trailing newline in the printout, we can save one character (the - at the beginning of the code)
Ruby, 43 characters
$><<([*' '..?~]-open($0).read.split(''))*''
Output:
!"#%&+,/123456789:;=@ABCDEFGHIJKLMNOPQRSTUVWXYZ\^_`bcfghjkmquvwxyz{|}
PHP (110 characters)
<?php
$w=file_get_contents(__FILE__);
$i=32;
while ($i++<126)
echo(strpos($w,chr($i))===false)?chr($i):'';
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.
Qgives the program's codeSTPgives all printable charactersSeis equal to Python'sset-substracts the two sets*is also the same as python'sPprints it.
Knowing this, this would convert to the following python:
for i in set(__import__("string").printable)-set(open(__file__).read()): print 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~
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;}
I know it's not winning any contests. I just wanted to try it in a language not normally used, just for kicks.
Java - 209 195 152 140 characters
class a{public static void main(String[]a){for(char c=0;;c++)System.out.print("publicas{tvodmn(Srg[])h=0;w+ye.\"\\xO<?:}".indexOf(c)<0?c:"");}}
With line breaks and tabs
class a{
public static void main(String[]a) {
for(char c=0;;c++)
System.out.print("publicas{tvodmn(Srg[])h=0;w+ye.\"\\xO<?:} ".indexOf(c)<0?c:"");
}
}
Beware if you execute: program does not terminate. Haha
Explanation
for(char c=0;;c++): Since acharcan be treated as anint, I use that to my advantage here to increment through all possible values ofc. I omit the terminating condition in the loop (the one that would go between the two semicolons) in order to save on characters, since it wasn't specified that the program had to terminate. :)"publicas{tvodmn(Srg[])h=0;w+ye.\"\\xO<?:} ".indexOf(c)<0?c:"": Sadly, not a very elegant approach, but it gets the job done. Manually list every character present in the source code as aStringliteral, then check whether the currentchar coccurs within it withindexOf(). If theindexOf()call returns-1, it doesn't exist, and therefore we should print it. The rest of it just uses the ternary operator to save on characters and space.
sh (47)
tr</dev/urandom -cd \[:print:]|tr -d "`cat $0`"
Uses the self-referential approach. Assumes /dev/urandom will eventually output every octet at least once. Doesn't terminate.
If we assume that man is installed, we could instead make use of the ascii(7) manpage (and thus have a terminating program) (44 chars, thanks @fennec).
man ascii|tr -cd \[:print:]|tr -d "`cat $0`"
Clojure (142, 106, 103)
(defn -main[](let[c"(fn[l](pr(reduce disj(set(map char(range 32 126)))l)));-\\\"o"]((load-string c)c)))
formatted:
(defn -main []
(let [c "(fn[l](pr(reduce disj(set(map char(range 32 126)))l)));-\\\"o"]
((load-string c) c)))
Think this does it, may need some tweaks. output:
#{@ ` ! A B b # C $ D % E & F ' G H I * J + K k , L M . N / O 0 P Q q R S 4 T 5 U V v 7 W w 8 X x 9 Y y : Z z { < | = } > ^ ? _}
runs the string, which is evaluateable clojure code, on itself. String has some comments at the end to get the characters used outside of the string (main method, etc)
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.
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?
[edit] trimmed one more char, thanks for the tip!
Brainfuck, 133 123 114 110 bytes
++++++++++++++++[->++++++>++>+++>++++>++<<<<<]>-->>->->+[---<.+.+<.+<.+<.+.+.+>>>>]++[-<.+.+.+<.+>>]<+.<+.<++.
A bit of more tinkering with a former solution (before I realized the below was smaller - allthough this was before I did some heavy optimization). This works by storing 4 sets of ascii numbers and print them with some tricky looping, and then give the missing characters afterwards (i.e. ones that are between invalid ascii numbers).
Original submission
>>+++++++++++[<+<+>>->++>+++<<]<++>>++++++>>+++++[-<<<++++++>>>]<<<+<<[->>+.<<]>>++.++<[->+.<]>++.+>[-<+.>]<++.+>>[-<<+.>>]
It does the following:
- Create 4 registers containing 11. 13, 28, 33
- Create a 5th with the value 31 to start the printing
- Print ascii 32-42 (11)
- Print ascii 44
- Print ascii 47-59 (13)
- Print ascii 61
- Print ascii 63-90 (28)
- Print ascii 92
- Print ascii 94-126 (33)
C, 83 74 69 characters
main(z) {for(;++z<96;"\33iE!vk?}GkRP8z"[z/7]&1<<z%7&&putchar(z+32));}
I really tried to get it down below 80 characters, but I just haven't been able to pull it off. I finally decided to post what I have, on the assumption that I (or someone else) will figure out 79-character solution ten minutes after posting this. Okay, it wasn't quite ten minutes, but it worked in principle.
I really wanted to post a version that didn't have to have a gratuitous space in the source code, but that one landed in a strange-attractor orbit, bouncing between a handful of solutions. After many minutes of trying to nudge one of them into a stable solution, I gave up and added the space.
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.
Javascript 94
a="",r="for(v=32;v<128;)c=String.fromCharCode(v++),a+=r.indexOf(c)<0?c:\"\"; alert(a)";eval(r)
Java - 126 characters
minimized:
class hjq{public static void main(String...w){for(char z='"'|0;++z!='a';)if("'()+.0;=OS".indexOf(z)==~0)System.out.print(z);}}
unminimized:
class hjq {
public static void main(String... w) {
for (char z = '"'|0; ++z != 'a';) {
if ("'()+.0;=OS".indexOf(z) == ~0) {
System.out.print(z);
}
}
}
}
This is an interesting problem, because individual tokens might benefit from their longer form because it re-uses characters. For example, normally String[] would be shorter, but String... removes the need for the square brackets in the conditional string.
I found the trick was to try and use characters at the beginning and end of the range so you can exclude them from the output simply by altering your loop start and end.
For Java, a key character to exclude is ", because having that in the string requires escaping it, which adds \ to your program, which needs to go in the string, which adds \\. By removing " from your conditional string you remove 4 characters. This can be achieved by making sure you use and ! and starting your loop from #.
All the lowercase letters appear near the end of the range, with only {, |, } and ~ coming after them. Because of Java's verbosity, most of the lowercase letters are used just for the boilerplate. Likewise, { and } are trivial for a Java program, because the boilerplate requires them.
| can be used if you have an or condition, but I couldn't find a way to take advantage of one that leads to a shorter program than just using | as a bitwise operator. The |0 makes me feel a little dirty, because it's the only part that's a nop just to get the character in there.
~0 yields -1, which is handy because that's what we need to check for with indexOf. Combining this with using != for the loop conditional eliminates the < character altogether, which means it doesn't need to go inside the conditional string.
F# - 66
Set.iter(printf"%c")(set[' '..'~']-set"Set.ir(pnf\"%c)s[' ~]-\\")
JavaScript - 88
alert("BCDFGHIJKMNPQUVXYZ".toLowerCase())// !#$%&'*+,-0123456789:;<=>?@[\]^_`{|}~AERTOWS
prints "bcdfghijkmnpquvxyz"
JavaScript: (96 bytes long, prints nothing, throws an error)
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
or
Valid JavaScript (97 bytes long, prints nothing)
' !"#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'
Python, 94
print !"#$%&'90*+,-.0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[/\]^_`abcdefghjklmoqsuvwxyz{|}
PowerShell: 96
Must be saved and run as a script.
diff([char[]](gc $MyInvocation.InvocationName))([char[]](32..126))-Pa|?{$_.SideIndicator-eq'=>'}
diff is a built-in alias for Compare-Object.
gc is a built-in alias for Get-Content.
$MyInvocation.InvocationName gets the full path to the script being executed.
32..126 is the decimal equivalent for 0x20..0x7e, and so creates an array of the decimal ASCII codes we're looking for.
[char[]] takes the contents of the next object and puts them into an array, breaking them up and converting them into ASCII characters. So, we now have two arrays of ASCII characters - one pulled from this script, the other defined by the challenge criteria.
-Pa sets Compare-Object to "Passthru" format, so only the items which are found different between the inputs are output at the console - indicators of which items were in which input are still stored in the object's data, but are not displayed.
|?{$_.SideIndicator-eq'=>'} pipes Compare-Object's output to Where-Object, which filters it down to only the items which are exclusive to the second input.
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{|}
Ruby (50)
puts (?#..?~).to_a.join.tr"()?!#.,~_aijnoprstu",""
Outputs:
$%&'*+-/0123456789:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^`bcdefghklmqvwxyz{|}
Not very serious, but I had to give it a go:
JSFuck (138152)
Original source:
for(x=0x7e;x>0x19;x--){
console.log(String.fromCharCode(x).replace(/[\[\]!\+\(\)]/ig, ''))
}
Prints all characters except ()+[]!
Befunge (48)
<|::-1,+*88:<+3*87
6<@.**85
9>"()~&"/%$ |!#';=?}
Outputs: {zyxwvutsrqponmlkjihgfedcba`_^][ZYXWVUTSRQPONMLKJIHGFEDCBA240
Javascript, 92
(function f(){for(i=32;126>i++;)!~(""+f).indexOf(c=String.fromCharCode(i))&&console.log(c)})()
J - 21
(u:32+i.97)-.1!:1<":5
write this to a file called 5 in the current directory. Then load execute the script with 0!:1<'5'
Or 25 without the file trick:
(-.~".)'(":u:32+i.0-~95)'
Ruby, 81 78 68 66 62 57
(?!..?~).map{|a|$><<a if/[()ifmap{}|?!.~\/\\\[\]$><]/!~a}
Simply checks itself. Duplicate characters manually removed.
Thanks to Josh for saving 4 characters, and minitech for saving 5 characters!
Definitely the longest solution here, but coding in Lino is always fun:
L.in.oleum - 655 523 characters
"libraries"/arch/cpu/base;/hmi/conout;/data/bytes;/data/string/t2s;/data/heap;/data/heap/connect/mgrab;"stockfile"a;"directors"displaystatus=engage;"injection"c=524;b<-bytes.bytesizeconvert:c;b<-heap.alloc:b;a<-heap.alloc:c;[filecommand]=readfile;[filename]=stockfile;[fileposition]=0;[fileblocksize]=c;[fileblockpointer]=b;arch.fileread;[string.psource]=b;[string.ptarget]=a;string.t2s;b<-heap.alloc:7fh;c=32;d=b;"f"[d_32]=c;+c;+d;?c<7fh>f;"w"d=[a];+a;?d=0>y;?d<32>w;?d>7eh>w;e=b;e+d;[e]=33;^w;"y"b+32;"v"conout.say:b;bye;
No comments, just reads the source compiled into binary. Save as a.txt or it won't compile!
Brainfuck, 173
+++++[->++++++<]>>>++[------<+>]<++++>>----[----<+>]>-[-------<+>]>-[---<+>]<------->>-[---<+>]<+++++++++>>--[-----<+>]<+++++>>+[---------<++>]+++++++++++++[<[.+<]>[>]<-]\=,
Pretty long, I might try again later.
Python 3 - 68 61
x=r"print(*set(map(chr,range(32,127)))-set(x+'=\"'))"
exec(x)
... thanks to @WolframH for the improvements.
Perl, 49 characters
say grep/[^+-246\[-^aceghmprsy]/,map chr,041..126
This is an interesting challenge -- it's sort of the anti-quine, and I've managed to shorten the program a couple of times by increasing the range of characters that appear in it.
GolfScript, 15 12 characters
{`),32>^.}.~
Based on Jan Dvorak's answer with a few twists and also in the style of Peter Taylor's one.
GolfScript (18 16 chars)
"),@`^^32>#.~".~
Online demo with an extra line which does a correctness check and outputs the number of characters in error.
(I have various equivalent alternatives. @`^ can be replaced with \\`; # can be replaced with ` or ]. The right combination can be used with Howard's trick to equal his score of 15 because backslashes don't need escaping in blocks the way they do in string literals: {),\`^32>].~}.~. But Howard deserves the credit for that trick).
Golfscript, 26 24 characters
"126,32>''+".~\-'.~\-"'-
Takes a range generation script, duplicates it, executes it, substracts it from its result, then substracts the result subtraction code and the other quote character.
J (52 40)
Edit: Duh, forgot about e.
'''(-@.e#[)~95{32}a'(-.@e.#[)~95{.32}.a.
Old version:
(>@(*/@('(>@*/''&~:).#]32{95}a'&~:)&.>)#])95{.32}.a.
Other variant (same length but less output):
([#~*/"1@('([#~*/"1@''&:0)95{.32}a'&~:"0))95{.32}.a.