J, 171 bytes
(+:>.+:^^*_){.".(':',~(+:+:>.^*_){(*:>.^*_)!:(+:<.^+:*_)''),',',(":(>:*:+:+:+:*_),(<.^<:^<:^*_),<:*:<.^+:*_),'+/',('.',~(+:<.+:^*_){(*:>.^*_)!:(+:<.^+:*_)''),":+:<.*:>:^*_
Ow... my brain hurts... Try it online!
Here's so you can see all of it one line (it won't run, though, with line breaks.)
(+:>.+:^^*_){.".(':',~(+:+:>.^*_){(*:>.^*_)!:(+:<.^+:*_)''),',',(":(>:*:+:+:+:*_),(<.^<:^<:^*
_),<:*:<.^+:*_),'+/',('.',~(+:<.+:^*_){(*:>.^*_)!:(+:<.^+:*_)''),":+:<.*:>:^*_
Only guaranteed to work with J version j805/j64/linux/release/commercial/www.jsoftware.com/2016-12-11T08:02:52
, in that order. (Only the first 12 characters matter.)
Explanation
Most of the program is devoted to constant generation. With those constants replaced with their values, the program looks like this:
(62){.".(':',~(12){(9)!:(14)''),',',(":(65),(97),48),'+/',('.',~(10){(9)!:(14)''),":26
With some parentheses removed, and some numbers made nicer:
62{.".(':',~12{9!:14''),',',(":65 97 48),'+/',('.',~10{9!:14''),":26
This is composed of a bunch of ,
and ,~
s, which append and prepend arguments. Here are the separate values:
":26
('.',~10{9!:14'')
'+/'
(":65 97 48)
','
(':',~12{9!:14'')
1
is 26
as a string.
9!:14''
generates the following string on TIO:
j805/j64/linux/release/commercial/www.jsoftware.com/2016-12-11T08:02:52
with 2
, we obtain the 10
th character (i
from linux
), and add a .
to the end of it, yielding i.
.
3
and 5
are self-explanatory.
4
is the list of numbers 65 97 48
as a string.
6
is similar to 2
, except it's the 12
th character (u
from linux
) and adds a :
to the end, yielding u:
.
This, all together, yields u:,65 97 48+/i.26
. ".
evaluates this, giving us:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789:;<=>?@ABCDEFGHI
(Note: +/
is tabulated addition.)
Then, with 62{.
, we take the first 62
characters from this, giving us ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
.
8This is somewhat ambiguous. If you mean output those raw bytes without those bytes in your code, then you should specify that you can't use the codepoints of these characters, even if they map to something else in your language's codepage. – FlipTack – 2017-01-05T19:57:42.370
11So this means that I cannot use any letters or numbers in my source code. Well, that pretty much takes out any non-esoteric languages. – R. Kap – 2017-01-05T20:04:59.440
2What if the language is just raw bytes (as opcodes) that don't have a representation? Am I free to use any characters? – FlipTack – 2017-01-05T22:03:32.380
Duplicates allowed? – user2428118 – 2017-01-05T22:33:06.073
@wat if the ASCII codes are printed does it matter if their underlying data type is
int
as opposed to actually being achar
? That is, can we output the numerical values, or must it be seen on the screen as the printable characters? – briantist – 2017-01-05T23:11:11.8001@briantist it's fine if they're internally represented by ints, but the characters themselves have to be printed. – dkudriavtsev – 2017-01-05T23:15:44.793
3@R.Kap Javascript could work, provided you don't think of it as eso – Destructible Lemon – 2017-01-05T23:32:41.877
If the code accesses an external file, do you intend to also prohibit those characters (or their codepoints) from appearing in the file? – Greg Martin – 2017-01-05T23:48:17.897
Is it OK to output some characters several times? Or should the output be exactly 26+26+10 characters? – anatolyg – 2017-01-06T00:10:14.733
@user2428118 no – dkudriavtsev – 2017-01-06T00:11:59.607
@anatolyg no;yes – dkudriavtsev – 2017-01-06T00:12:28.663
I meant my question seriously – FlipTack – 2017-01-06T00:20:49.390
@FlipTack You can't use the bytes that correspond to the ASCII codes of those characters. – dkudriavtsev – 2017-01-06T01:04:40.680
1Trying to think of a way to achieve this in Perl 5, supposedly one of the most punctuation-laden of languages, but it's actually quite hard to do anything without letters and numbers. Something like
$\
->$&($")can eliminate the need to spell out
print(if you can get the values "STDOUT", "print" (or "say"), and your desired output into the three variables).
STDOUTis a key in
%::, but how does one find it there without
foror
grep` or anything of the sort? – hobbs – 2017-01-06T07:49:58.0471I like the clarification "Rules: No cheating" – gcampbell – 2017-01-06T20:44:05.747
Why didn’t https://codegolf.stackexchange.com/a/105784/78446 win
– Arvin Kushwaha – 2018-11-24T19:45:47.833@ArvinSingh I didn't see it. Fixed. – dkudriavtsev – 2018-11-24T22:46:56.853