16
2
You should write a program or function which outputs or returns as much of Chapter I of The Little Prince as it can. Your program or function has to be an M-by-N block of code containing only printable ascii characters (codepoint from 32 to 126) and newlines at the end of each row.
You can only use at most 26 characters of your choosing from the 96 printable ascii characters (and the newlines at the end of the rows).
In each row and column every character has to be distinct similar to a sudoku puzzle i.e. there can't be a letter in a row or column twice.
A correct example codeblock with M = 4
, N = 3
and alphabet = {a,b,c,d,/,*}
:
abcd
bcd*
*/ac
Code details
- You can choose the shape of your code-block (i.e.
M
andN
). - The block has to be filled with characters entirely i.e. every row has to have the same length.
- A trailing newline at the end of the last row is optional.
- As written above in each row and column every character has to be distinct.
Output details
- You should output or return a prefix of Chapter I of The Little Prince without any additional output.
- If you reach a newline in the text you can represent it as any common variant (\r,\n,\r\n) but use only one of them and count it as 1 byte to the score.
- An extra trailing newline is optional.
Your score is the length of the output text excluding an additional newline if present. Higher score is better.
Example answer
##Python3, score = 6
alphabet = `print('O\ce w)#X` (alphabet element count = 16)
print('O\
nce w')#X
You can check the validity of your code with this Python 3 (ideone) program or this CJam program (online) provided by @MartinBüttner.
Doesn't this limit the program size to 26x26 at most? – marinus – 2015-04-28T12:35:20.763
@marinus Yes it does. – randomra – 2015-04-28T12:35:51.600
Are you sure this is solvable? – FUZxxl – 2015-04-28T13:16:25.307
@FUZxxl the question contains a reference solution with score 6. Hopefully the question is designed such that it's not possible to print the entire thing (or it would need a tie breaker). – Martin Ender – 2015-04-28T13:17:48.167
@MartinBüttner Ah! I forgot about the “a prefix of...” part. – FUZxxl – 2015-04-28T13:19:03.033
by "prefix" you mean that the words must be in order, starting from the beginning? – sirpercival – 2015-04-28T14:49:59.063
I don't think anyone will get the whole thing. There are information density concerns, even if you could use all 626 characters to encode it. I predict someone will do some clever compression into a ~16 character codeset, and get maybe 400 characters of output. – Sparr – 2015-04-28T17:28:08.710