107

Vim, 25 23 bytes :h<_↵jjYZZP25@='Ypx$p'↵ Where ↵ is the Return key. :h<_↵ Open the help section v_b_<_example. jjY Copy the "abcdefghijklmnopqrstuvwxyz" line. ZZP Close this buffer and paste in ours. 25@=' '↵ Run these commands 25 times: Yp ...


40

AMD64 Assembly (78 bytes or 624 bits of machine code) uint8_t SubByte(uint8_t x) { uint8_t y,z; uint8_t s[]= {1,221,146,79,147,153,11,68,214,215,78,220,152,10,69}; uint8_t k[]= {0,32,50,6,20,4,22,34,48,16,2,54,36,52,38,18,0}; if(x) { for(y=z=1;(y=(y<<1)^((y>>7)*29)) != x;z++); x = (z % 17); z = (z / 17); ...


30

05AB1E, 6 5 bytes Thanks to Downgoat for saving 1 byte. Code: ADv=À Explanation: A # Push the lowercase alphabet. D # Duplicate it. v # For each in the alphabet... = # Print without popping and with a newline. À # Rotate 1 to the left. Uses the CP-1252 encoding. Try it online!.


28

Ruby, 100% (74 characters) Input on STDIN, output on STDOUT. Vj=s=gets;puts(s.tr'!-~','P-~!-O');Vj;'lDl86EDjAFEDWD]ECVP\OV[V!\OP\~VXj;' The second line is the first line ROT-47'd. Therefore, when ROT-47ing the whole program, it becomes: ';lDl86EDjAFEDWD]ECVP\OV[V!\OP\~VXj';jV=s=gets;puts(s.tr'!-~','P-~!-O');jV My strategy here is based upon the fact ...


27

Python 2, 59 57 53 bytes a=range(65,91)*27 a[::-27]=[10]*26 print bytearray(a) Thanks to @xsot for -4 bytes!


27

CJam, 72 67 66 63 bytes ri{_2md142*^}es*]2#~Hmd{5\}e|Fm2b"Ý0$&Ü™ÖD�’ ˜×EO“N".*Lts:^i es* repeats something by the current timestamp, which is a big number, and it would take too long to finish. Actually testable version, 64 bytes: ri{_2md142*^}256*]2#~Hmd{5\}e|Fm2b"Ý0$&Ü™ÖD�’ ˜×EO&#...


23

Jelly 71 59 bytes H^142ƊHḂ?Ƭi2d17U⁸⁴;$Ḣ?$CµṪạ⁴B¬T;;6ị“Œ0$&ØŀWð⁺Ṫ\ḢĠVı⁻¹]°Ẇ‘^/ Try it online! Verify all possibilities Now rewritten using a reworked version of jimmy23013’s clever CJam answer so be sure to upvote that one too! Uses only 472 bits (28.0% of the naive approach). @jimmy23013 has also saved another byte! Explanation Stage 1 Ƭ ...


18

///, 220 bytes /|/\/\///n/WXY|m/JKL|l/PQRS|k/CDEF|j/ZaNfV|i/MbAeI|h/TUcO|g/GHdB|f/OlTU|e/BkGH|d/ImMbA|c/VnZaN|b/NfVnZ|a/AeImM/ab ed kg DEFgC EFgCD FgCDE gk HdBkG de mi KLiJ LiJK im ba fc lh QRShP RShPQ ShPQR hl UcOlT cf nj XYjW YjWX jn Try it online! This was surprisingly non-trivial and I have no clue whether it's optimal. The only way to golf a problem ...


17

C, 47 bytes i;f(){for(i=702;i--;)putchar(i%27?90-i%26:10);} Try it on Ideone A single loop, printing the alphabet every 26 characters but with every 27th character replaced by a newline.


16

C - 54.6% Y;BW;XL;jNj;AW(){XL^Y;};main(int i,char**v){char*x=v[1];while(*x){if(*x>32&&*x<128)*x=(*x+15)%94+32;putchar(*x++);}}//Y^Nj>2:?W:?E :[492CYYGXL492CYIlG,`.jH9:=6WYIXL:7WYImbaUUYIk`agXYIlWYIZ`dXThcZbajAFE492CWYIZZXjNN When ROT-47-translated, we get *jq(j){j;};jp(WXL){/*jNj>2:?W:?E :[492CYYGXL492CYIlG,`.jH9:=6WYIXL:7WYImbaUUYIk`...


16

C (gcc), 237 bytes #define P(a,l)x=a;a=S[c=l>>r%4*2&3];S[c]=x; r,c,x,y,z;G(unsigned*S){ for(r=24;r;*S^=r--%4?0:0x9e377901+r){ for(c=4;c--;*S++=z^y^8*(x&y)) x=*S<<24|*S>>8,y=S[4]<<9|S[4]>>23,z=S[8],S[8]=x^2*z^4*(y&z),S[4]=y^x^2*(x|z); S-=4;P(*S,33)P(S[3],222)}} I probably gained bytes with my swapping method, but it'...


16

C (gcc), 157 148 140 139 bytes Modest improvement over the C example. l,b=17,*k=L"@`rFTDVbpPBvdtfR@";p(x){for(l=256;--l*~-x;)x=2*x^x/128*285;return l%b?k[l%b]^"\xcer?\4@6\xc8\t{|\3q5\xc7\n"[l/b]-b:k[l/b]^188;} Try it online! C (gcc), 150 142 127 126 bytes This one depends on gcc and x86 and UTF-8 quirks. l,*k=L"@`rFTDVbpPBvdtfR@";p(x){for(l=256;--l*~-...


15

J, 15 bytes u:65+26|+/~i.26 Online interpreter. u:65+26|+/~i.26 i.26 creates vector [0 1 2 ... 25] +/~ builds an addition table with itself 26| modulo 26 to every element 65+ add 65 to every element u: convert every element from codepoint to character


15

///, 128 bytes /:/fABCDEFGHIJKLMNOPQRSTUVWXYZ fbfbAfxf xbA_xf_x xfbbbAfbb//x/bff//f/\///b/\\:B:C:D:E:F:G:H:I:J:K:L:M:N:O:P:Q:R:S:T:U:V:W:X:Y:Z: Try it online! Inspired by Jakube's amazing answer to the L-phabet challenge, I thought I'd try my hand as well at actual programming in /// as opposed to just using it for compression. This was pretty tricky and ...


14

Python 2, 91 bytes s="import md5;print'MD5 sum of my source is: '+md5.new('s=%r;exec s'%s).hexdigest()";exec s Using the Python quine variant which doesn't require repeating everything twice. Tested on ideone.


13

Jelly, 15 bytes 251©xX€⁵0¦ḅЀ%® Expects t, n, and s as command-line arguments. Try it online! How it works 251©xX€⁵0¦ḅЀ%® Main link. Left argument: t. Right argument: n Third argument: s 251© Yield 251 and copy it to the register. x Repeat [251] t times. X€ Random choice each; pseudo-randomly choose t integers ...


13

Stax, 65 64 62 59 58 bytes ç∙¼≥2▼Uó╤áπ╙º┐╩♫∟öv◘≥δ♦Θ╫»─kRWÑâBG")≥ö0╥kƒg┬^S ΔrΩ►╣Wü Ü╕║ Run and debug it Unfortunately, this program uses some instructions that internally use some deprecated stax instructions. I just forgot to update their implementation. This causes some spurious warning to appear, but the results are still correct. This is inspired by ...


12

J I*, 536 431 417 380 263 218 203 197 186 167 p=:4 :0 a=.u:65+9-.~i.26 ,_2(5|,:~@|.@(=/)+$$,A.~5*1-0{=/)&.(5 5#:(~.n x,a)&i.)\(,'X'#~2|#)(({.,'X',}.)~1+2*1{&I._2{.\2=/\]) ::]^:_(n=:a(e.~#])'JI'charsub toupper)y ) (with extensive suggestions from @algorithmshark) example use: 'Stack Overflow' p 'The cat crept into the crypt, crapped, and ...


12

CJam, (4 + 8 = ) 12 bytes Encoding program: q2/z Try it online here Decoding program: q_,2/)/z Try it online here How (or rather, why) they work: The Diagonal Burrows-Wheeler transform is basically every other character of the string, with wrapping from the end. If we treat the String as a 2D matrix of 2 columns, it simply boils down to taking the ...


12

Python, 109 bytes by Sp3000 Note that Martin cracked first, so I'm not sure if this deserves points. On the other hand, I did make a preimage attack rather than a simple collision - a much stronger result. This means that you can give it an arbitrary hash value, and it will construct an input that generates that hash value. M = 2**128 # The hash to crack. ...


12

Emacs, 47 bytes abcdefghijklmnopqrstuvwxyz^M ^P <F3> ^K ^K ^Y ^Y ^P ^<space> ^F ^W ^E ^Y ^A <F4> ^U 2 4 F4 Where ^P means "Control P", etc. That's 47 bytes, since the F3 and F4 keys require two ASCII bytes. After entering the starting input, it defines a keyboard macro to duplicate the line and move the first character to the end. It ...


11

Pyth, 10 9 bytes qJrz0_XJG Try this fiddle online or verify all test cases at once. Explanation qJrz0_XJG rz0 Lowercase input J Store a copy in J _XJG Translate J with the reverse alphabet and reverse q Compare


11

Jelly, 7 bytes ØAṙJṢj⁷ Try it online! How it works ØAṙJṢj⁷ Main link. No arguments. ØA Set argument and return value to "ABCDEFGHIJKLMNOPQRSTUVWXYZ". J Yield the indices of the argument, i.e., [1, ..., 26]. ṙ Rotate the alphabet 1, ..., 26 units to the left. This generates all rotations, but not in the correct order. Ṣ ...


11

JavaScript (ES6), 56 bytes _=>"ABCDEFGHIJKLMNOPQRSTUVWXYZ".replace(/./g,"$&$'$`\n") Yes, that's right, half my code is the alphabet string literal. Best I could do without the literal is 81 bytes: _=>[...Array(26)].map((_,i,a)=>a.map(_=>(i++%26+10).toString(36)).join``).join` ` If you want a program rather than a function, then remove the ...


10

vim, 5 keystrokes Assuming normal mode and that the text is already written in the buffer: ggg?G Or, fallowing vimgolf's conventions: g?GZZ You can also invoke it as a terminal command, something like this: $ vim -c 'norm g?G' - < your text here ... ... multiple lines if you want ... ... terminate input with ctrl+D on a blank line > I guess the ...


10

R, 37 bytes example("chartr");cat(rot(scan(,""))) example("chartr") runs the examples for chartr, which includes the rot function, which is ROT13 by default....


10

GolfScript, 120 / 120 bytes = 100% {:&&32>&&+254<*{7+7+94%33+}*}%LiUUbamUUZadckYLfZfZhcTbbZNYNT or, in ROT-47: LiUUbamUUZadckYLfZfZhcTbbZNYNT{:&&32>&&+254<*{7+7+94%33+}*}% No comments or string abuse. The undefined command LiUUbamUUZadckYLfZfZhcTbbZNYNT (which equals the rest of the code in ROT-47) is a no-op, ...


10

C, 88 64 bytes Call f() without arguments. f(i,j){for(i=j=0;i<26;putchar(j==26?j=0,i++,10:65+(i+j++)%26));} Try it on ideone.


10

Python 3, 1423 1348 1324 1316 1300 1286 1250 1249 1209 1206 1204 bytes This is definitely the longest golf I've ever done, and the only golf where I was seriously worried about running out of one-character variable names. Golfing suggestions welcome. Try it online! I'm encoding with the uppercase Latin alphabet with additional characters . and #, using 0-...


10

05AB1E, 101 100 98 97 95 94 bytes U•α">η≠ε∍$<Θγ\&@(Σα•₅вV₁[<ÐX*Q#X·₁%Xžy÷Ƶ¹*₁%^₁%U}D17©%DĀiYsès®÷•¾#kôlb¸ù,-ó"a·ú•₅вë\Ƶ∞s®÷Y}sè^ -3 bytes thanks to @Grimy. Try it online or verify all test cases. Explanation: Port of Xavier Bonnetain's C function (1106 bits version) from here, with the same improvement @ceilingcat made in his C answer ...


Only top voted, non community-wiki answers of a minimum length are eligible