# Printing ascending ASCII, Robbers

In the cops thread, the task was to create a program that outputs printable ASCII characters in ascending order. The robbers task is to unscramble the code the cops used to produce this output.

The cracked code doesn't have to be identical, as long as it has the same length and any revealed characters are in the correct positions. The language must also be the same (version numbers can be different). The output must of course be identical. Cops can not use comments in their code, but robbers are free to use them.

The winner of the robbers thread will be the user who has cracked the most submissions by January 7th 2016. If there's a tie, the user who has cracked submissions with the longest combined code will win.

The submission should be formatted like this:

Code:

alphaprinter

Output

abcdefghijklmnopqrstuvwxyz

Pietu1998: 3
Mitch Schwartz: 2
Quintopia: 2
Martin Büttner: 2
cat: 1
Dennis: 1
isaacg: 1
jimmy23013: 1
MegaTom: 1
plannapus: 1
user81655: 1

++++[>++++[>++++<-]<-]+++[>++++++++<-]>++[>+.<-]

Pretty straightforward, generating 64 and then 26. It might be a little red herring that

++++[>++++[>++++<-]<-]>>+

is a way to get 65, so you might try to do something like

++++[>++++[>++++<-]<-]>>+[>+++++>++<<-----]>>[<.+>-]

before noticing that it's a dead end.

• Ahhh, well done :) Dec 27 '15 at 7:20

# Python 2, 76 characters, wnnmaw

Code, with obfuscated version below:

print "BKT]f"#__h______________________v_____________,___)_________)_______)
print __________h______________________v_____________,___)_________)_______)

This outputs BKT]f. Not the intended version, that's for sure haha.

Tested here

• Sneaky comments :) Dec 29 '15 at 14:11
• That'll teach you to post a program whose output is shorter than the length of the program in a language that has print unless you have revealed characters in exactly the places the string would have to sit. Dec 30 '15 at 15:29

# CJam, 12 characters, Dennis

":0[Aa#":,:^

It's in the tips...

• Right, I had forgotten about the tips... Dec 26 '15 at 15:46

# CJam, 8 characters, Martin Büttner

Code (with blanked code):

{:)$}_~ __:_____ Output: %*;a|~ Try it online. I sort of had a feeling about this from the moment I saw it. And I thought I didn't know CJam... # Labyrinth, 5 characters, Martin Büttner Code: !!!>@ Test it here Output: 000000 # JavaScript (ES6), 17 characters, Neil As the OP posted a function, here's a solution using a function: ()=>xxx=11000+233 __=____=_________ The anonymous function can be invoked like: (()=>xxx=11000+233)(); A more ridiculous solution I had at first: xx=yyyy=z=11230+3 __=____=_________ When run in the console, it will print the number 11233. • Ninja'd me. I got fx=asdf=> "11233" Dec 26 '15 at 20:28 • @CᴏɴᴏʀO'Bʀɪᴇɴ Thought, I had to be fast on this one. :D Dec 26 '15 at 20:30 • Well, kudos to you on your fastest gun in the west. +1 Dec 26 '15 at 20:31 • -1 for no strings :P – user46167 Dec 26 '15 at 20:35 • @CᴏɴᴏʀO'Bʀɪᴇɴ's version seems to be the only one that's a function that returns a string. – Neil Dec 26 '15 at 21:20 # PHP, 28 characters, Niet the Dark Absol I found several versions for this task: Original version: <?=@implode(range('a','z')); My version: <?=join('',range('a', 'z')); 23 character version: <?=join('',range(a,z)); 26 character version: <?=implode('',range(a,z)); Of course, you can just add several whitespaces to get to the 28 character mark. Tested here • Dang, you beat me :P The shortest I can do: <?=join(range(a,z)); Dec 26 '15 at 20:37 • You got me - maybe I should have made it more restrictive by putting one of the letters of a function name as the revealed characters... Anyway, for the record, here's the original: <?=@implode(range('a','z')); Dec 26 '15 at 20:38 # Jolf, 27 characters, Cᴏɴᴏʀ O'Bʀɪᴇɴ After a few hours of trial and error, I got it haha: on-pl'u'Wa-n"vwxyz"--'01_2 Including obfuscated code: on-pl'u'Wa-n"vwxyz"--'01_2 ________W___________--_____ | Try it here (step run seems to be the only one working with alert) ### Explanation First thing I got stuck on was the placement of the while loop. I didn't seem to get it on the right place haha. After getting it right, the second thing I noticed was the placement of the underscore. I thought I almost got it, until I got stuck on the underscore (gg Cᴏɴᴏʀ O'Bʀɪᴇɴ). Here is full explanation of the code: on-pl'u'Wa-n"vwxyz"--'01_2 o # assign n # n / standard variable pl # pl = "abcdefghijklmnopqrstuvwxyz" - 'u # pl - "u" = "abcdefghijklmnopqrstvwxyz" 'W # a string in the middle doing nothing -n"vwxyz" # n - "vwxyz" a # alert(  # is an extra semicolon -'01 # "0" - 1 - _2 # ("0" - 1) - negative 2 In pseudocode: n = minus("abcdefghijklmnopqrstuvwxyz", "u"); "W"; alert(minus(n,"vwxyz")); ; minus(minus("0", 1), negative(2)); I'm interested to see what the actual solution was :) • holy mother of God not what I intended o______o but nice job, anyhow! I posted the actual code on my answer. Dec 28 '15 at 0:50 # Pyth, 6 bytes, Pietu1998 Ssy>TG Take the last 10 letters of the alphabet, form all subsets, concatenate, sort. # R, 60 bytes, Fax Machine Code: cat(c(0:9,LETTERS[1:8],LETTERS[20:26],letters[4:23]),sep="") Output: 0123456789ABCDEFGHTUVWXYZdefghijklmnopqrstuvw ## Seriously, 7 characters, by quintopia 2'aNsES Tested here. Splits 99 bottles of beer around as and sorts the third chunk. • I used the 7th chunk, but the result is the same. Knew this one would be a cinch ;) Dec 28 '15 at 13:17 # Python 3, 58 bytes, Mathias Ettinger import string;print(''.join(sorted(string.printable))[5:]) Basic use of string module. • I didn't see that you'd cracked this before me, I tried using string but didn't think of using sorted (because I forget it exists). I don't know if I should leave my crack up, since it's nowhere near the same method but it works. – cat Dec 29 '15 at 0:34 • @cat I don't know what Stewie Griffin's opinion would be about that, but anyway I gave you +1 and think it makes sense to keep your answer up since it's not the same answer as mine. Dec 29 '15 at 1:26 ## 05AB1E, 13 characters, Adnan Code (and blanked code): 1TD*<F3<*}bRJ __D____<_____ Output: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 Explanation: 1 Push 1 TD*< Push 99 F } For loop 3<* multiply top of stack by 3-1 (e.g. double it) b convert to list of binary digits (note we have just computed 2^99) R reverse it J join it into a string. (top of stack implicitly printed) • Woooww!! Amazing job :) Dec 29 '15 at 10:27 ## JavaScript, 83 characters, BlockCoder1392 a=aaaaraaaa=uaaaa=aasaa=console;b=0;a.log("Hi~~~");auaaaaaaaAaaaaaaaa =aeaaaa="^~^" A bit too many characters for such a short string. ## JavaScript (ES6), 60 characters, insertusernamehere Code: e=e=>{try{a}catch(e){return[...e.toString()].sort().join}} e_e_______a__a____e___e________e__o___________o______o______ Output (in Chrome): :ERacddeeeeeeffiinnnoorrrrst I knew this immediately because I was about to do the same thing! xD • Nice one - character by character. :D Dec 26 '15 at 23:13 • @insertusernamehere You could have done [...e+''] to make it a bit shorter. That threw me off at the start. ;) Dec 26 '15 at 23:14 • What does return[...e.toString()] actually do? I only know a lil JS... – cat Dec 27 '15 at 5:20 • @cat It just puts each letter of the error message into an array. It needs to do this because sort only works on arrays, not strings. Dec 27 '15 at 5:31 # Pyth, 6 characters, Adnan Code (with blanked code): S.n 3 S_____ Output .0113345678888999 Try it online. It's φ's representation, sorted. This could've been done in 5, if you remove the space. • Awww, I forgot about the backticks :p. My original code was S+.n3" Dec 27 '15 at 17:52 # Malbolge, 254 characters, frederick Obfuscated version: _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ __ My version: ('&%: ^"!65 4Xzyx w4-Qs rpo'K mlk"' ~Dfdc ba}v< ::8[Z XnVlq }0/mO ,*MbK JH^6# 4C|0 ?U=Sw uPsaq L4on2 Mjjh, ged)c '<$$p ]!};Y WiVxS eRQ>= ).K]l Ij"Fh gfedc b,=;z L\q%H X3E2C /ng-k N*KJI 8%6#D ~2^Ai >g<<d tUr6 oJ"!1 /|{CU f)d>b <A_^! \};Yj yUxTS dtsr ML This will output: AB\cd You can try it here. # Befunge, 11 characters, histocrat Code: 89'**'z...@ Output: 1223788 That was fun. This is an alternate solution I also found: 8]..@#37.z' • Oh, cool, funge-98 solutions. Dec 29 '15 at 20:22 ## 05AB1E, 7 characters Adnan Code and blanked code: 576T*uH ___T___ Output: 22368 Explanation: 576 Push this number. T Push ten. * Multiply. (5760) u Convert to string. H Interpret as a hex number and push decimal (22368) (implicit output). I almost positive this wasn't the original program, but thanks to Adnan for providing the one bit of information that made it possible (the u command). • I think this was the original program haha. Well done :) Dec 30 '15 at 15:36 This answer is invalid and shouldn't count towards my score (not that I'm anywhere near winning anyways) because I didn't see it had already been cracked. # Python 3, 58 characters, Mathias Ettinger Code, with original code below: x=range(95); print(''.join((chr(i+32) for i in x ) )) ______________print(_______(_______________________)_____) Clearly not the intended solution, which was: import string;print(''.join(sorted(string.printable))[5:]) Output: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~

A fun one to crack: it took me a while to figure how to get the genexpr to work properly. :)

# Pyth, 17 characters, Luke

Code (with blanked code):

Su]G6*Tt"#X0231
___________#____1

Output:

""''''''''''''''''''''0000000000111111111122222222223333333333XXXXXXXXXX[[[[[[]]]]]]

Try it online.

This was fun. I got it to 18 bytes multiple times using # as the filter operator, but then I figured out I could just discard it from the string. If you remove the t and the # the result would probably be the shortest Pyth code for that output.

Basically:

• "#X0231 makes the string #X0231
• t"#X0231 removes the #: X0231
• t"#X0231 gets the string representation: 'X0231'
• *Tt"#X0231 multiplies it by 10: 'X0231''X0231''X0231'
• u]G6*Tt"#X0231 wraps it in an array 6 times
• u]G6*Tt"#X0231 gets the string representation: [[[[[['X0231''X0231']]]]]]
• Su]G6*Tt"#X0231 sorts it to get the output
• Very nice! And pretty different from what I had done.
– Luke
Dec 29 '15 at 23:45

# CJam, 9 characters, by username.ak

'a{_)}25*

Try it online!

### How it works

'a         e# Push the character 'a'.
{  }25*  e# Do 25 times.
_       e# Copy the character on the stack.
)      e# Increment the copy.

# Perl 5, 30 characters, msh210

Obfuscated + my version:

print_________________________
print "9:;\@AFGHLMNRSTYZ_a"

This will output:

9:;@AFGHLMNRSTYZ_`a

Tested here

# Python 2, 62 characters, RikerW

Obfuscated version:

______________________________________________________________
| |   ||                  |  |  ||

My version:

print "ab_c_de___".replace("_","")#___________________________

This simply removes all the underscores and outputs abcde.

Tried it here