# Printing ascending ASCII, Cops

Write a program or function consisting only of printable ASCII characters (that excludes tab and newline) that outputs at least 5 printable ASCII characters in ascending order (from space to tilde / 32 to 126). Characters can be outputted several times, as long as they are adjacent to each other. A single trailing newline is accepted. You must provide the full output, and for every 6 characters in your code you must provide one character in your code, at the position it appears. If your code has 5 or less characters, then you have to reveal only the length. You shall not reveal more than 1 character per 6 in your code.

So if your code alphaprinter outputs the alphabet from a-z, then you need to reveal 2 characters of your code (use underscore for the others), for instance:

al__________  // or
__p__p______  // or
__________er

Rules / specifications:

• You cannot append trailing white spaces that doesn't have a function.
• You can not use comments (but the robbers can use comments when cracking the code)
• Built-in cryptographic primitives (includes any rng, encryption, decryption, and hash) aren't allowed.
• In languages where the default output are like in MATLAB: ans =, then that's accepted, as long as it's clearly stated and shown that ans = is outputted. It should also be clearly stated whether this is part of the "ascending output" or not.
• The output must be deterministic
• Using a non-free language is not accepted
• The output doesn't have to be consecutive characters. Both abcde and abcdg are valid outputs.
• The characters do not need to be distinct as long as the output contains at least 5 characters. aaaaa and aaacc are valid.
• Answers that assumes a REPL environment are not considered to be valid programs or functions and are therefore not allowed.
• STDERR is not considered valid output, but data may written to STDERR.

If the revealed characters are underscores, then you must identify it as shown below. In this case, the second and sixth character are revealed underscores, while the others are unknown.

_____________
|   |

Note: The robbers only need to find a code that produces the same output. The language, the length of the robbers solution, and the position of the revealed characters must also match.

Your score is the number of characters in your code. The winner will be the submission with the lowest score that hasn't been cracked in 7 days. Only submissions that are posted in 2015 (UTC) are eligible for the win. Submissions that are posted later than this are welcome, but can not win.

In order to claim the win you need to reveal the full code (after 7 days).

Your post should be formatted like this (nn is the number of characters):

# Language, nn characters

Output:

abcdefghijklmnopqrstuvwxyz

Code (12 characters):

al__________

If the code is cracked, insert [Cracked](link to cracker) in the header. If the submission is safe, insert "Safe" in the header and reveal the full code in your answer. Only answers that have revealed the full code will be eligible for the win.

• Does this mean that if my code is print ( "abcde" ), I can reveal three whitespaces? – Adnan Dec 26 '15 at 12:07
• @Adnan, technically yes, you can. – Stewie Griffin Dec 26 '15 at 12:15
• When somebody makes a seed answer, we might not even know the length of the code. – wizzwizz4 Dec 27 '15 at 9:03
• @wizzwizz4 Seed isn't allowed – Adnan Dec 27 '15 at 10:03
• @Adnan I suppose it doesn't require any brainpower, only brute-force power. – wizzwizz4 Dec 27 '15 at 10:15

Because I majorly f'ed up my last answer.

# Mouse-2002, 23 chars, safe

Code:

________9<^___________

Output:

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ab # Ruby, 32 characters, safe Output (with no trailing newline): !"#$%&'(+,./567;<HKLUVWnouvw

Obfuscated code:

________{|c|___________________}

Revealed code:

95.times{|c|c&5*c<7&&putc(c+33)}

Explanation:

Actually pretty straight-forward, just too arbitrary to easily guess or brute-force. For each number c from 0 to 94, bitwise-and c and 5*c. If the result is less than 7, add 33 and output as an ASCII character.

# Pyth, 15 characters (safe)

Code:

_CM____________

Output:

"$%'()+-./013456789:;=?BCEFGIKLOPRSTUWXYZ[]^abcdefghjklmoqsuvxy{| You can try Pyth online. I wonder if you can find out the criteria for the characters. :3 Additional hint: One could have a computers firm like Captor's Fermium totally messed up on just this one puzzle, and still they wouldn't fully solve it. Even the actor Frump Mise couldn't solve it. ## Original code sCMf%sPT3rCN127 Explanation: rCN127 generates all numbers from 34 (CN = ord('"')) to 127. f%sPT3 finds all the ones that satisfy the following: the sum of the prime factors of n is not divisible by 3. s concatenates the results. The first hint has the number 3, and it refers to filtering the characters/numbers. The additional hint contains 3 anagrams of prime factor sum. # Recall, 64 characters Output: ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~ Code: _D_0__0_M__________0__0___0_________Z___0____0_____________M____ Pretty straightforward in theory. I made a sandbox here, so you can try things. Keep in mind that infinite loops or deep recursion will crash your tab/browser, so keep a copy elsewhere when trying. You can also download recall.min.js from the link in the title and run it with node.js. # PHP, 61 characters Gonna try again, if that's okay :p I wasn't expecting range('a','z') to be particularly well-known, but I should have known better around here ;) Code: <?p___________++<_______h__________e______1____p_____________ Outputs: AAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBCCCCCCCCDDDDDDEEEEEEFFFFFGGGGGHHHHHIIIIJJJJKKKKLLLMMMNNNNOOOPPP # Octave, 18 bytes: Output in Octave: ans =$'())**+,,--../0011233

Note that ans =_ (replace _ with space) is how Octave prints output by default and is not part of the output string. The output string alone starts with a single leading space like this:

$'())**+,,--../0011233 Code: [________:_______] Disclaimer: If this miraculously should end up being the shortest uncracked submission, I'll award the win to the runner-up. This won't be a winning submission, I just wanted to have some fun too. And I figured a relatively short MATLAB/Octave submission could be fun for others. The other one was too hard for me at least. # Python 2, 76 characters, Cracked by Adnan print __________h______________________v_____________,___)_________)_______) Outputs BKT]f Full Code print "".join([chr(x) for x in list(reversed(range(32,126)[70:5:-9]))[3:8]]) • Cracked – Adnan Dec 28 '15 at 21:43 # 05AB1E, 7 characters, cracked by quintopia Obfuscated code: ___T___ Original code: 576T*uH 576 # Pushes 576 T # Pushes 10 * # Multiply the last two items of the stack u # To uppercase, this just returns 576 in string format H # Convert from hexadecimal to decimal Note: I used the uppercase command to convert the int to a string. This however is a bug and has already been fixed. Output: 22368 # Marbelous, 19 characters _1 ___0 ____ _____1 Outputs 39?E( • "Write a program or function consisting only of printable ASCII characters (that excludes tab and newline)..." – cat Dec 30 '15 at 18:38 • @cat check the comments on the other Marbelous submission – Sparr Dec 30 '15 at 22:27 # Marbelous, 39 characters (safe) _ is an unknown character: it may or may not be a newline. * represents a newline character. __^__________*__<___________@___/_*____ Output: %,:>?@@BBFFNN^^~~ Code: @0^5FF 0101FC \\<ZEE <</\+S @0+Z// 25-- Online interpreter. None of the options should be checked. • Unfortunately, the code can only consist of printable ASCII. – Martin Ender Dec 26 '15 at 13:34 • OP's comment: This is a valid post, although it says in the challenge that only printable ASCII characters should be used in the code. I confirmed to es1024 that newlines could be used. This will be the only exception to this rule. – Stewie Griffin Dec 26 '15 at 13:35 • @StewieGriffin Do you mean than nobody else can use newlines; only es1024 in this answer is allowed to use them? – Mitch Schwartz Dec 27 '15 at 6:37 • Not allowing newlines effectively excludes Marbelous from these challenges. No non-trivial program can be written in mbl without vertical movement of marbles. – Sparr Dec 30 '15 at 18:16 • @Sparr I don't see how the comments on this answer are agreeing with you. If nobody else can use newlines, then you can't either. – cat Dec 30 '15 at 22:33 # PHP, 68 characters, safe As usual, don't expect anything short from PHP: ______________________________1_________________________________[1_; | | | | | | | | Outputs this 252 character long string: AAAAAAAABCCDDEEEEEEEGIIIIIKLMNNOOOOOOOOOPPPPRSSTTTUUUUUXYYZaaaaaaaaaaaaaabbbbccccccccccccdddddddeeeeeeeeeeeeeffffffggghhhhiiiiiiiiiiiklllllllllllllllmmmmmmnnnnnnnnnnooooooooooooooopppppppppppppqrrrrrrrrrrrrrrsssssssssssssssssstttttttttuuuuuuuuuwxyyyzzz Hint 1 Sometimes you have to "translate" things. Hint 2 Luckily PHP stores all those helpful "translations" for you internally. Revealed code There aren't too many built in functions, that return long strings or arrays with predefined values. One exception is get_html_translation_table. I sorted this array and returned the first character after the & from all escape sequences, e.g. the A from &Auml;. It has a nice distribution which looks random because the amount of entities related to a letter varies a lot.$_=get_html_translation_table(1);sort($_);foreach($_ as$_)echo$_[1];
______________________________1_________________________________[1_;
>| | | | | | | |

• Unexpected T_PAAMAYIM_NEKUDOTAYIM? – cat Dec 27 '15 at 0:52
• @cat Hihi. But it might be a different kind of translation. ;) – insertusernamehere Dec 27 '15 at 1:01

# Milky Way 1.6.1, 24 characters, Safe

Output:

jklmnopqrt

Code (24 characters):

^_"_________________"__!

### Solution

^^"pqrjklmno"C=<<<"t"JG!

## Seriously, 7 characters, (uncracked and noncompeting)

I was inspired by trying to find an answer to Adnan's latest cop, by how close this number was to their number:

___P___

Output:

22366

22366 is the 211th triangular number. The original program was 8PτPurΣ but it is disqualified for containing two non-ASCII characters. It simply takes the 8th prime (23), doubles it (46), finds the 46th prime (211), then pushes the 0-211 range (ur) and sums it.

• Just to confirm, this code contains only printable ASCII? – Martin Ender Jan 4 '16 at 22:26
• No. Guess I missed that requirement. Thought only the output had to be printable ascii. Well I can tell you it consists only of printable CP-437 characters. – quintopia Jan 5 '16 at 0:27
• Since this doesn't meet the criteria, I suggest you edit it to note that it and its robbers are noncompeting. – msh210 Jan 5 '16 at 20:07
• But I don't want it's robbers to be noncompeting! Can't the robbers get credit for cracking it even when it is not a legal cop? – quintopia Jan 6 '16 at 0:47

# MirBSD Korn Shell, 62 characters, safe

Output:

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~ Code (62 characters): ______________32________________127____________________echo_$s

Revealed code:

typeset -i1 x=32;while let ++x\<127;do s+=${x#1#};done;echo$s

# Pyth, 6 characters (cracked by isaacg)

Output:

Code:

S_____

Let's try a simpler one.

• Cracked – isaacg Dec 28 '15 at 1:12

Output:

Code:

_#_________3____

# JavaScript (ES6), 59 characters

Output:

"""'''(((((())))))+++++++++,,,,,,---------...............123:::===>>>???NNNNNNOOO[[[[[[\\\]]]]]]^^^______aaabbbbbbccccccddeeeeeeeefgggggggggggghhhiiiijjjjjjjjjkkklllllllllnnnnnooooooooorrrssstttttttttu{{{}}}

The first 3 characters in the output are spaces.

Code:

(_____________________________________________.join_____)

Note: The original version of this produced a much greater variation in characters with the exact same code hint, but I thought the output was unreasonably long so I decided that I'd at least give someone a chance at cracking this. :P Good luck!

# Forth, 29 chars

You're gonna need a very special version of Forth for this one: one that doesn't require newlines after function definitions.

Code

_______ __ _________ ____ ___

(Yes, that's whitespace, and yes, it has to be there or else one gets Error: Unknown word)

Output:

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Note the leading space. # CJam, 9 chars Code: '_{___2__ Output: abcdefghijklmnopqrstuvwxyz • Cracked. – Dennis Dec 30 '15 at 21:17 # Brainfuck, 51 chars Code _____[________________]>.>_____[________]>[_______] Output: ABCDEFGHIJKLMNOPQRSTUVWXYZ • +++++[>+++++++++++++<-]>.>+++++[>+++++<-]>[<<+.>>-] – Mitch Schwartz Dec 30 '15 at 18:23 • @Mitch Schwartz wow, it's exactly the same as real code – username.ak Jan 5 '16 at 10:03 # Python2, 72 chars Code: ___(___(___(___((_____)_(____)_)______________(______)________________) Full output (63,769,891 bytes) as compressed by zlib (use import zlib; zlib.decompress(...) to get the actual string, which I recommend writing to a file) • Shouldn't this reveal 12 characters? – Dennis Dec 31 '15 at 1:41 • @Dennis it absolutely should, I pasted the wrong version (after I added bytes.) – cat Dec 31 '15 at 1:56 • can you provide a run-length-encoded version of the output for easier analysis? – quintopia Dec 31 '15 at 7:27 • yeah, sure, gimmie a sec – cat Dec 31 '15 at 13:05 • @quintopia here ya go – cat Jan 2 '16 at 13:43 ## Purple, 31 characters (safe) __A_____________o______b__1___b Full program: a1AbA1iib{bi1b1Bo1aaa1bbab1Bi1b Output: abcdefghijklmnopqrstuvwxyz Explanation: It's about the shortest way to print the alphabet in Purple. 1. a1A Set to 1-"a" == -96 2. bA1 Set b to -1 (using the fact that a is always negative) 3. iib{ Set i=i-b, i.e. i+1. This skips over the "{" 4. bi1 Set b = i-1 (the cell before the current command, containing "{") 5. b1B Set b = 1-"{" == -122 6. o1a Output 1-a (which will be the current character) 7. aa1 Subtract 1 from a (i.e. move to the next character) 8. bba Set b=b-a. It will be negative until a==-122, when it will be zero 9. b1B Set b=1-what b points to. It will be 0 until a==-122, when it will be -96. 10. i1b Jump to 1-b. This goes to line 2 until a==-122, when it jumps outside the program and halts. ## Perl 5, 31 bytes, safe Code: print__________________________ Output:$%&&'+,,-1223478899:>??@DEEFJKKLLMPQRRSWXXY]^^_

Code:

print+(chr)x(1.2+cos)for 36..95

# Octave, 22 characters, Safe

Code:

__A____________A___V__

Output:

ans = ABCDFGHHIJLMNNOPRSTTUV

ans = is not part of the output. The output starts with an A.

Real code:

[(A=66:86)+sin(A),'V']

Explanation:

In Octave, variable assignments can be done in the same line they are used. So, the variable A is created starting from 66 (corresponds to A in ASCII) to 86 (corresponds to V in ASCII). +sin(A) creates a small sine wave noise. 'V converts the vector to chars and adds a V at the end. The variable name A and the last letter V was of course chosen to throw people of track =)

This one was made for the robbers. Hope it's neither too hard nor too easy. Good luck :-)