Shoot the ASCII Moon
GolfScript, -153
{""''!$%&()*+,-./:;<=>?@[\]^_`|~#
}ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
Prints
{""''!$%&()*+,-./:;<=>?@[\]^_`|~#
}
Score:
- 97 bytes of source code: +97
- Shooting the Sun: -250
Try it online.
How it works
Since the code block (lambda, anonymous function)
{""''!$%&()*+,-./:;<=>?@[\]^_`|~#
}
does not contain any syntax errors, it will be pushed on the stack and printed verbatim if left on it. The linefeed is required to end the comment that #
started.
Finally, ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
is an undefined token; it does nothing.
C++, 310
Well, I started this without realizing that @
and backticks are totally disallowed in C++ source. Posting it even though it's a very poor entry as it stands, in case anybody knows a way out. Is there a compiler that would allow these characters in symbol names?
#include<IOSTREAM>
int main(int bgjkpqvwxyzBCDFGHJKLNPQUVWXYZ$){\
for(char _='!';_<127;++_){_==48?_=58:_==65||_==98-1.?_+=26:!~_^_&_*_%3,""[0];std::cout<<_;}}//
- 160 bytes
- 5 * 30 unique symbolic characters = 150 point penalty
Edit: -90
Leaving the above because it's a little more interesting than the following, which uses an unused #define
to sneak in the missing symbols.
#include<IOSTREAM>
#define bgjkpqvwxyzBCDFGHJKLNPQUVWXYZ !"#$%&'*,-./@[\]^`~
int main(){for(char _=33;_<127;++_){_==48?_=58:_==65||_==97?_+=26:_;std::cout<<_;}}
- 160 bytes
- Shooting the sun, -250 points
CJam, -66
{'"#$%&()*.+,-/:!;<=>?@[\]^_`|~}""
Prints every symbol exactly once, without any extraneous whitespace.
Score:
- 34 bytes of source code: +34
- Shooting the Moon: -100
Try it online.
How it works
Since the code block (lambda, anonymous function) {'"#$%&()*.+,-/:!;<=>?@[\]^_`|~}
does not contain any syntax errors, it will be pushed on the stack and printed verbatim if left on it.
Since "
only appears in the character literal '"
, we also push an emoty string as ""
, which won't affect the output.