56
6
In a programming language of your choice, write 95 programs, each of which outputs a different one of the 95 printable ASCII characters without that character occurring anywhere in the program.
For example, if your language was Python, your program that outputs the character P
might be
print(chr(80))
because P
has ASCII code 80. This program is valid because P
never appears in the source code. However, for the program that outputs lowercase p
, something like
print(chr(112))
would be invalid because, while it does print p
, p
is present in the code. A valid program could be
exec(chr(112)+'rint(chr(112))')
which prints p
but does not contain p
.
Your goal is to make each of your 95 programs as short as possible. Your score is the sum of the character lengths of all your programs.
If for any reason you are unable to write valid programs for some characters, you may mark those characters as "Did Not Program" or DNP, and omit programs for them entirely. This way syntactically strict languages will be able to compete.
The winning answer is the answer that has the lowest score of the set of answers that have the fewest DNP's.
Rules
The source code of all of your programs may only contain printable ASCII plus tabs and newlines, all of which are counted as one character. (Because in a different encoding it would be easy to omit characters that don't exist!)
- Note: This rule seems necessary but there are many languages with different encodings and I'm sure it'd be cool to see the answers for them. Therefore you can break this rule, you can use whatever characters you want, but then your answer becomes non-competitive, it cannot win.
The programs must be actual, full programs, according to your language's standard conventions. Functions and REPL snippets are not allowed.
Each program's output should go to stdout or your language's accepted alternative.
Programs should not prompt for or require input. (If prompting for input is inherent to your language, that's ok.)
Programs should be deterministic, finite in run time, and independent. e.g. it shouldn't matter if one is run in a folder separate from the other programs.
A program's output should be the precise printable ASCII character it corresponds to, optionally followed by a single trailing newline, nothing more, nothing less.
Be sure to include information on all 95 (ideally) programs in your answer, as well as your score and any DNP's. You don't have to list all programs that follow a simple pattern like "print(chr(80))
, print(chr(81))
, print(chr(82))
..." but make sure you're sure they all would work and that your score is added correctly.
For reference, here are the 95 printable ASCII your programs must output:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
If in my encoding 0x30 codes for, say, 日 rather than 0, then can I assume that the printable ASCII are the regular 95, minus 0, add 日? – Leaky Nun – 2016-08-21T13:08:10.727
4What? You need to use printable ASCII. That's just a rule. – Calvin's Hobbies – 2016-08-21T13:10:47.207
I believe there are encodings which do not have the exact representation of 0x30 as
0
– Leaky Nun – 2016-08-21T13:17:36.943@LeakyNun EBCDIC – TuxCrafting – 2016-08-21T13:59:09.890
Could I specify a condition such as "must be run in a directory which only contains a file named " " (space)"? – Tim – 2016-08-22T02:18:00.763
2@Tim No. Doesn't follow the independence rule. – Calvin's Hobbies – 2016-08-22T02:21:29.677
Am I required to use ASCII-1967, or is ASCII-1963 okay? – Mark – 2016-08-22T23:16:46.337
@Mark Use the modern '67 version. – Calvin's Hobbies – 2016-08-27T03:28:55.003