Output or display the following three lines of text, exactly as they are shown below. A trailing newline is accepted.


That block of text is the same as the one below, but where the n'th column is rotated n times downward:


Keep in mind that this is a challenge, so the output format is not flexible.

  • 1
    \$\begingroup\$ Does the text end on a newline ? In particular is it ok to end on '....z\n\n` ? \$\endgroup\$ – Ton Hospel Feb 14 '18 at 18:03
  • 2
    \$\begingroup\$ @Tom no, it should maximum be one trailing newline \$\endgroup\$ – Stewie Griffin Feb 14 '18 at 19:10
  • \$\begingroup\$ Is a leading newline acceptable? \$\endgroup\$ – Dom Hastings Feb 15 '18 at 8:42
  • \$\begingroup\$ @DomHastings No, sorry. \$\endgroup\$ – Stewie Griffin Feb 15 '18 at 8:43
  • \$\begingroup\$ (for many languages (HTML, ///, Text, Bubblegum) hardcoding those 80 characters would be (provably, except for Bubblegum) the shortest, that is boring, please don't do that) \$\endgroup\$ – user202729 Feb 23 '18 at 8:19

44 Answers 44


Java 8, 169 162 150 146 116 113 106 95 94 93 92 91 90 84 bytes

Yay, we finally did it! We've beat the 88-byte literal output that can be found at the bottom. Thanks to all those who participated in the golfing!

v->{for(int i=0,t=0;++i<81;System.out.printf("%c",i%27<1?10:(4-t++%3)*32%97+i%27));}

-7 bytes thanks to @StewieGriffin.
-42 bytes thanks to @Neil.
-11 bytes thanks to @PeterTaylor.
-3 bytes thanks to @OlivierGrégoire.
-6 bytes thanks to @OlivierGrégoire and @Neil (Olivier suggested a port of Neil's JavaScript answer).

Try it online.


v->{                          // Method with empty unused parameter and no return-type
  for(int i=0,t=0;++i<81;     //  Loop from 1 to 81 (exclusive)
     System.out.printf("%c",  //   Print the following character:
      i%27<1?                 //    If it's the last column
       10                     //     Print a new-line
      :                       //    Else:
       (4-t++%3)*32%97+i%27   //     Print the correct character based on the index

See here what each of the arithmetic parts do, and how it ends up at the correct characters.

Java 8, 88 bytes

v->" bC#eF&hI)kL,nO/qR2tU5wX8z\nA!cD$fG'iJ*lM-oP0rS3uV6xY9\naB\"dE%gH(jK+mN.pQ1sT4vW7yZ"

Boring, but utilizing the intended rotation of columns won't be any shorter in Java for sure.. I stand corrected! Will post a solution in a moment either way to see how much bytes it differs. Apparently the difference is just -4 bytes! :D

Try it online.

  • 1
    \$\begingroup\$ Based on my CJam approach, I'm pretty sure there should be a reasonably simple arithmetic formula for the code point at position (x, y), which will most likely beat your 169-byte approach and maybe even the literal string. \$\endgroup\$ – Martin Ender Feb 14 '18 at 11:20
  • 1
    \$\begingroup\$ 116 bytes: v->{String a="";for(int i=2,j,t;++i<6;){for(j=31;++j<58;a+=(char)(t<1?j+65:t>1?j:j+33))t=(j-i)%3;a+="\n";}return a;} \$\endgroup\$ – Neil Feb 14 '18 at 12:15
  • 1
    \$\begingroup\$ Ahem, 95: v->{for(int i=0,r,c;++i<81;System.out.printf("%c",c<1?10:32*++r+c-1/r))r=(i/27+28-(c=i%27))%3;} \$\endgroup\$ – Peter Taylor Feb 14 '18 at 14:55
  • 1
    \$\begingroup\$ 92 bytes (removed c entirely) \$\endgroup\$ – Olivier Grégoire Feb 15 '18 at 11:07
  • 4
    \$\begingroup\$ @OlivierGrégoire Java outgolfing JavaScript? What did I do wrong? \$\endgroup\$ – Neil Feb 15 '18 at 19:55

Husk, 13 bytes


Note the trailing space. Try it online!


Tzṙṫ26¡m→"Aa   No input.
         "Aa   The string "Aa ".
      ¡        Iterate
       m→      map successor: ["Aa ","Bb!","Cc\"","Dd#",..
 z             Zip with
   ṫ26         the reversed range [26,25,24,..,1]
  ṙ            using rotation: [" Aa","b!B",..,"z9Z"]
               This also truncates the list to length 26.
T              Transpose, implicitly print separated by newlines.

SPL (Shakespeare Programming Language), 1679 1618 1600 bytes

Act I:.
Scene I:.
[Enter Ajax and Ford]
You are the remainder of the quotient between the sum of the remainder of the quotient between the product of me and a fat joy and the sum of the cube of a big red day and the difference between a red fat pig and a big old fat cow and the quotient between me and the sum of a day and the square of the sum of a joy and a big red day and the sum of a cat and a fat son.
[Exit Ajax]
[Enter Puck]
Am I as good as nothing? If so, you are a bad big old red fat day. Am I as good as a joy? If so, you are the sum of a joy and a the cube of an old bad day. Am I as good as a big day? If so, you are the sum of the square of the sum of a big red fat cat and an old cow and the sum of an old war and a lie.
[Exit Ford]
[Enter Ajax]
You are the sum of thyself and the remainder of the quotient between me and the sum of a man and the square of the sum of a son and a big fat cow. Speak thy mind!
[Exit Puck]
[Enter Ford]
You are the sum of yourself and a son.
You are the remainder of the quotient between me and the sum of a cat and the square of the sum of a cow and an old red sky.
Am I as good as nothing? If so, let us proceed to scene III.
Scene II:.
You are the product of the sum of a fat man and a cow and the sum of a man and the square of the sum of a cat and a big red son. Are you not better than me? If so, let us return to act I. Let us proceed to scene IV.
Scene III:.
You are the sum of a big old fat cat and a red cow. Speak thy mind! Let us return to scene II.
Scene IV:.

I had some issues with the interpreter (https://github.com/drsam94/Spl), so it's not as small as I think it could have been. But at least this works :)

Here's the same logic in PHP, to make it a bit easier to see what's going on.


$ford = ((2 * $ajax) % 52 + $ajax / 26) % 3;
if ($ford == 0) {
    $puck = 32;
if ($ford == 1) {
    $puck = 65;
if ($ford == 2) {
    $puck = 97;
$puck = $ajax % 26 + $puck;
echo chr($puck);

$ajax = $ajax + 1;

$ford = $ajax % 26;
if ($ford == 0) {
    goto Act1Scene3;

if ($ajax < 78) {
    goto Act1Scene1;
goto Act1Scene4;

$ford = 10;
echo chr($ford);
goto Act1Scene2;

  • 4
    \$\begingroup\$ The speeches in this sound like a demented Dr. Seuss book. :^D \$\endgroup\$ – DLosc Feb 15 '18 at 18:25

JavaScript (ES6), 86 75 bytes


Edit: Saved 11 bytes thanks to @Ryan. Now 10 bytes shorter than the literal!

JavaScript (Node.js), 64 bytes


Try it online! Thanks to @Ryan.

  • 2
    \$\begingroup\$ You can save 11 bytes with recursion: f=(i=k=0)=>i-80?String.fromCharCode(++i%27?(4-k++%3)*32%97+i%27:10)+f(i):'' and 11 more in a Node environment as an aside: f=(i=k=0)=>i-80?Buffer([++i%27?(4-k++%3)*32%97+i%27:10])+f(i):'' \$\endgroup\$ – Ry- Feb 17 '18 at 10:45

05AB1E, 17 15 bytes

Saved 2 bytes thanks to Erik the Outgolfer


Try it online!


žQ                 # push the list of printable ascii characters
  Au               # push upper-case alphabet
    A              # push lower-case alphabet
     )ø            # zip
       ε           # apply to each
        ¼          # increment counter
         ¾G        # for N in [1 ... counter] do:
           Á       # rotate string right
            ]      # end loops
             ø     # zip
              »    # print list joined by newlines
  • \$\begingroup\$ @Emigna I feel like εN should be a thing. Combines the two ideas of vyNFÁ])ø» and yours. \$\endgroup\$ – Magic Octopus Urn Feb 14 '18 at 13:22
  • \$\begingroup\$ @MagicOctopusUrn: Yeah, I have often wanted N while using ε. It doesn't technically fit as ε isn't a loop, though as we sometimes use it as such, it would be nice to have it. \$\endgroup\$ – Emigna Feb 14 '18 at 13:34

CJam (18 bytes)

26{_" Aa"f+m>}%zN*

Online demo


The obvious approach is to generate the original lines, zip, rotate with ee::m>, and zip back. But ee:: is quite long, and it's shorter to generate the columns directly.

26{         e# For i = 0 to 25...
  _" Aa"f+  e#   Generate the unrotated column by offsets from the starting chars
  m>        e#   Rotate the appropriate distance
zN*         e# Zip and join the rows with newlines

Python 2, 72 bytes

exec"r='';exec'r+=chr(x/3);x+=291*(x<180)-94;'*26;print r;x-=78;"*3

Try it online!

This works by removing 31.333.. from the previous character, adding 97 when the previous codepoint is less than 60, and subtracting 26 at the end of each line.


R, 64 63 bytes


Try it online!

-1 byte thanks to Giuseppe

I arrived at this through quite a bit of trial and error, so I'm struggling with a concise explanation. Essentially, instead of the character codes, I started off with a more simple sequence of 1:81 representing the original block of text (3*26 plus 3 newlines), and examined the indices of where these values end up in the rotated block. This follows a regular sequence that drops by 26 each time, modulo 81 (or equivalently, increases by 55 mod 81). It was then a matter of recreating that sequence (0:80*55)%%81+1]), mapping to the real unicode values c(32:57,10,65:90,10,97:122,10), converting to characters and printing.

  • \$\begingroup\$ well done! I'll be bounty-ing this, although I really expected another solution in the 80+ byte range, so I think I'll up the bounty to 100. \$\endgroup\$ – Giuseppe Feb 15 '18 at 13:33
  • \$\begingroup\$ @Giuseppe No worries! It's more about the challenge than the rep to be honest. \$\endgroup\$ – user2390246 Feb 15 '18 at 14:05
  • \$\begingroup\$ ah, you can save a byte using 55 instead of -26 since -26 == 55 (mod 81). \$\endgroup\$ – Giuseppe Feb 15 '18 at 14:25
  • \$\begingroup\$ @Giuseppe Thanks for the suggestion, and for the bounty! \$\endgroup\$ – user2390246 Feb 26 '18 at 15:01

Japt, 17 15 bytes

;By@=cÄ é

Test it online!


"@`"         The string "@`\x1F". The following newline sets U to this string.
;            Reset variables A-L to various values. B is set to
 B           the uppercase alphabet, which we only use to get a length of 26.
  y@         Map each column Z (initially just the letter itself) through this function:
     cÄ        Increment each char-code in U.
        é      Rotate by 1 character.
    =          Set U to the result to keep the chain going.
             This generates the 26 columns exactly how we needed them.
             Implicit: output result of last expression

7 other possible 15-byters:

;By@" Aa"c+Y éY

CJam, 23 21 bytes

3{26{_I-" aA"=+}/N}fI

Try it online!


3{         e# For I from 0 to 2...
  26{      e#   For i 0 to 25...
    _I-    e#     Duplicate i and subtract I. This shifts the starting
           e#     character of each line left in the following string.
    " aA"= e#     Pick the character at the start of the unrotated line
           e#     of the current character. We basically just cycle
           e#     through non-letters, lower-case, upper-case, which is
           e#     the cycle throughout the result. Due to the I-, when
           e#     We get to the second line we start from A, and on the
           e#     third line we start from a.
    +      e#     Add i to the starting character to get the correct
           e#     column.
  N        e#   Push a linefeed.
  • 3
    \$\begingroup\$ Very nice explanation. I especially like: "Push this random-looking string." :P \$\endgroup\$ – Stewie Griffin Feb 14 '18 at 11:07
  • 2
    \$\begingroup\$ @StewieGriffin sorry, that string had to go. \$\endgroup\$ – Martin Ender Feb 14 '18 at 11:28

MATL, 16 bytes


Try it online!


1Y2     % Push 'AB...Z' (predefined literal)
t       % Duplicate
k       % Maker lowercase
9V      % Push 9, convert to string representation: gives char '9'
:       % Range. For chars, gives string from space to that
v       % Concatenate vertically. Gives a 3×26 char matrix
26      % Push 26
:       % Range. For numbers, gives numeric vector from 1 to that
l&YS    % Circularly shift each column of the first input (char matrix)
        % by the amount specified by the second input (numeric vector).
        % Implicitly display
  • 2
    \$\begingroup\$ Nice :) I still struggle when I must change the default I/O formats of functions... :( \$\endgroup\$ – Stewie Griffin Feb 14 '18 at 12:41
  • 1
    \$\begingroup\$ oohh very nice with the order of the strings to use 1:26 as the shift. I should try that in my R answer... \$\endgroup\$ – Giuseppe Feb 14 '18 at 13:42
  • 1
    \$\begingroup\$ @StewieGriffin Meta-function & was a great addition, from Suever's idea :-) \$\endgroup\$ – Luis Mendo Feb 14 '18 at 14:58
  • \$\begingroup\$ @Giuseppe Yes, that saved a byte :-) \$\endgroup\$ – Luis Mendo Feb 14 '18 at 14:58

Jelly, 13 bytes

26“ aA‘ẋs+ḶỌY

Try it online!

How it works

26“ aA‘ẋs+ḶỌY  Main link. No arguments.

26             Set the argument and the return value to 26.
  “ aA‘ẋ       Repeat [32, 97, 65] (code points of ' ', 'a', and 'A') 26 times.
        s      Split the result into chunks of length 26.
          Ḷ    Unlength; yield [0, ..., 25].
         +     Add [0, ..., 25] to each of the chunks.
           Ọ   Unordinal; cast all integers to characters.
            Y  Jojn, separating by linefeeds.

Perl 5, 46 bytes

print map{chr$n+++ord,$/x!($n%=26)}($",A,a)x26

Saved 13 bytes thanks to @TonHospel's arcane wizardry!

Try it online!

  • \$\begingroup\$ Your $i++ is just $_ and you can use say instead of print so this is really 50 \$\endgroup\$ – Ton Hospel Feb 14 '18 at 14:26
  • \$\begingroup\$ Mmm, and it's easy to get rid of the {} in the map too for 49: say map$/x/26|52/.chr$_%26+(32,65,97)[$_%3],0..77 \$\endgroup\$ – Ton Hospel Feb 14 '18 at 14:57
  • \$\begingroup\$ @TonHospel Yes, of course! Thanks! \$\endgroup\$ – Dom Hastings Feb 14 '18 at 15:37
  • \$\begingroup\$ Redesigning the loop gives 47: print map{chr$n+++$_,$/x!($n%=26)}(32,97,65)x26. Unfortunately say gives one newline too many. \$\endgroup\$ – Ton Hospel Feb 14 '18 at 18:20
  • \$\begingroup\$ And a fun 48: say map$/x/.A/.chr$n++%26+(65,32,97)[$n%3],A..BZ \$\endgroup\$ – Ton Hospel Feb 14 '18 at 19:32

R, 88 86 bytes


Try it online!

R is terrible at string manipulation and although it has some neat matrix builtins, rotations are another thing it doesn't do very easily. I will happily give a bounty to anyone who can out-golf me in R.

Despite my having found a shorter answer, I'll still award a 50 rep bounty to the first other R answer shorter than 88 bytes.

I suppose I'd award myself the bounty if I could, but this is a whole two bytes shorter than the "boring" answer! I avoid rotations by just using R's penchant for recycling.

EDIT: user2390246's answer completely outgolfed me and I will be awarding a 100 point bounty since that solution is far superior.

To get here, I deconstructed the desired output to their ASCII code points with utf8ToInt (removing the newlines), built a matrix, and ran a diff on themm getting the columnwise differences. Noting the periodicity there, I set out to construct the matrix in a golfy fashion, hoping to use diffinv to recreate the original.

Thanks to the periodicity, we can recreate the diffed matrix by forcing R to recycle with a non-multiple length, and extract the columns we actually wanted:


Then we invert this process, with diffinv to recreate the code points, append a row of 10 (newlines) to the bottom, reconvert to ASCII with intToUtf8, and cat the result.

  • 3
    \$\begingroup\$ You can sort of give yourself a bounty. The bounty would cost you x rep, and you'd gain x rep from it... So, consider it done! \$\endgroup\$ – Stewie Griffin Feb 14 '18 at 15:21
  • 2
    \$\begingroup\$ Challenge accepted! \$\endgroup\$ – user2390246 Feb 15 '18 at 13:13

Stax, 14 12 bytes


Run and debug it

Unpacked, ungolfed, and commented, it looks like this.

3R26        push [1,2,3] and 26
K           cross-map using the rest of the program, printing lines implicitly
            this instruction maps over a cartesian join
  -         subtract
  " Aa"@    index into " Aa" using the subtraction result
  i+        add the iteration index

Run this one

This program only uses features that have been available since the initial release of stax, but apparently I forgot about K for cross-map when I originally write this answer.

One nearly interesting thing to note about this answer is that the R is an unnecessary instruction because K implicitly turns integers into ranges. However there's no way to push 3 and 26 without some extra byte in between.


PowerShell, 53 bytes


Try it online!

I see this is similar to Dom's Perl answer, but I arrived at it independently.

This exploits the fact that the pattern goes Symbol - Lowercase - Capital, even when wrapping newlines (8 - z - A, for example), and thus just adds the appropriate offset (chosen via $j++%3) to the current number $_ before -joining those together into a single string. That's done three times to come up with the three lines (preserving $j between iterations). Those three lines are left on the pipeline, and the implicit Write-Output gives us the newlines for free.


Julia 0.6, 79 bytes

println.([prod([' ':'9' 'A':'Z' 'a':'z'][n,mod1(i-n,3)] for n=1:26) for i=2:4])

[' ':'9' 'A':'Z' 'a':'z'] is the unrotated 2d array of characters, [n,mod1(i-n,3)] indexes into that array with appropriate rotation. prod takes a Vector of Characters to a String (since multiplication is used for string join). There are two nested Vector comprehensions resulting in a Vector containing 3 strings, then println. prints the each string in the Vector followed by a newline.

TIO lacks the appropriate method to multiply (with prod) two characters to get a String. I know that method was added somewhat recently, but the TIO version appears to be the same as the version on my PC where this code works, so I can't fully explain why it doesn't work on TIO.

Copy paste example (the ; isn't necessary, it just supresses extra output in the REPL):

julia> println.([prod([' ':'9' 'A':'Z' 'a':'z'][n,mod1(i-n,3)] for n=1:26) for i=2:4]);

Charcoal, 26 21 15 bytes


Try it online! Link is to verbose version of code. Explanation:

 ³              Literal 3
E               Map over implicit range
   β            Lowercase letters
  ⭆             Map over characters and concatenate
            κ   Outer index
             μ  Inner index
           ⁻    Subtract
       γ        Printable characters
        α       Uppercase letters
         β      Lowercase letters
     §⟦   ⟧     Circularly index into list (selects one of the three strings)
              μ Inner index
    §           (Circularly) index into string
                Implicitly print each inner map result on a separate line

J, 29, 27 25 bytes

-2 bytes thanks to FrownyFrog -2 bytes thanks to miles

 |:u:(<26)2&(|.>:)32 65 97

Try it online!

Initial approach: J, 29 bytes

u:(-|."_1&.|:32 65 97+/])i.26

Explanation: i.26 - range 0-26

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

32 65 97+/] - create a 3-row table for the characters

   32 65 97+/i.26
32 33 34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57
65 66 67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122

&.|: transpose then do the next verb (|.) and transpose again

-|."_1 rotate each row n times

     (-i.26)|."_1|:32 65 97+/i.26
 32  65  97
 98  33  66
 67  99  34
 35  68 100
101  36  69
 70 102  37
 38  71 103
104  39  72
 73 105  40
 41  74 106
107  42  75
 76 108  43
 44  77 109
110  45  78
 79 111  46
 47  80 112
113  48  81
 82 114  49
 50  83 115
116  51  84
 85 117  52
 53  86 118
119  54  87
 88 120  55
 56  89 121
122  57  90

u: convert to unicode

    u:(-i.26)|."_1&.|:32 65 97+/i.26

Try it online!

  • \$\begingroup\$ @FrownyFrog Thank you! Apparently I didn't check the possibility to create the matrix column-wise. \$\endgroup\$ – Galen Ivanov Feb 14 '18 at 19:16
  • 2
    \$\begingroup\$ |:u:(<26)2&(|.>:)32 65 97 saves 2 bytes. \$\endgroup\$ – miles Feb 14 '18 at 23:54
  • \$\begingroup\$ @miles Thanks for the great code! \$\endgroup\$ – Galen Ivanov Feb 15 '18 at 0:05

C, 70 69 67 60 64 bytes


+4 bytes to make the function reusable.

Invalid 60-bytes answer that isn't reusable:


Port of my Java 8 answer @Neil's JavaScript answer.

Try it online.

  • \$\begingroup\$ Since functions have to be reusable and this function does not exit cleanly, it leaves the global variables behind. You need an i=t=0. \$\endgroup\$ – Jonathan Frech Feb 28 '18 at 1:07
  • \$\begingroup\$ @JonathanFrech Fixed \$\endgroup\$ – Kevin Cruijssen Feb 28 '18 at 7:47

APL+WIN, 26 bytes

Index origin 0

⎕av[(-⍳26)⊖32 65 97∘.+⍳26]

Generate a matrix of integer index values of the characters in the APL atomic vector.

Rotate each column downwards by its number value.

Use the resulting indices to display the characters from the atomic vector.


Vim, 81 79 bytes

a !"#$%&'()*+,-./0123456789␛:h<_␍jjYZZpPgU$klqq"aDjlma"bD"ap`ajD"bpkkp`akl@qq@q

Explanation (simplified)

a !"#$%&'()*+,-./0123456789␛    Insert the first line
:h<_␍jjYZZpPgU$                  Insert the alphabet twice by copying it from the help page
klqq                             Define the loop `q`:
"aDjl                             Cut the rest of the line to `a`
ma"bD"ap                          Replace the rest of the second line (cut `b`, paste `a`)
`ajD"bp                           Replace the rest of the third line (cut `c`, paste `b`)
kkp                               Paste `c`
`akl@qq@q                        Run the loop, each time one more step to the right

C, 72 bytes


Python 2, 65 bytes

for x in 2,99,196:s='';exec"s+=chr(32+x%291/3);x-=94;"*26;print s

Try it online!


brainfuck, 121 115 bytes


Thanks to @JoKing for saving 6 bytes!

Try it online!

  • \$\begingroup\$ 115 bytes by fiddling about with the number generation \$\endgroup\$ – Jo King Feb 21 '18 at 1:24
  • 2
    \$\begingroup\$ +++[[<+>>++<-]>] really is the start of everything, huh? Thanks! \$\endgroup\$ – Dennis Feb 21 '18 at 1:38

Japt, 17 bytes

26Æ" Aa"c+X éX÷y

Test it


26Æ           Ã       :Create the range [0,26) and pass each X through a function
   " Aa"              :  String literal
        c+X           :  Add X to the codepoint of each character
            éX        :  Rotate right X times
               ·      :Join with newlines
                y     :Transpose
  • \$\begingroup\$ Oooh, I had a different solution that may or may not be enough to warrant a separate answer: ;Bå_cÄ é}"@`" ·y \$\endgroup\$ – ETHproductions Feb 14 '18 at 13:07
  • \$\begingroup\$ Well now that we're the same length I feel better about it ;-) \$\endgroup\$ – ETHproductions Feb 14 '18 at 13:13
  • \$\begingroup\$ @ETHproductions: looks different enough to me :) Was going to see if I could come up with a shorter solution by mapping over C after lunch. Don't know how y and · ended up the wrong way 'round; I must have Ctrl+Zed too many times before Ctrl+Aing! \$\endgroup\$ – Shaggy Feb 14 '18 at 13:18

Python 2, 79 bytes

exec"o=0;r='';exec'r+=chr(o+[32,65,97][(p-o)%3]);o+=1;'*26;p+=1;print r;"*3

Try it online!


APL (Dyalog Unicode), 23 bytes (Adám's SBCS)

(⎕UCS-⊖∘↑32 65 97+⊂)⍳26

Try it online!

-1 thanks to Adám.

Runs in an interactive environment.

Assumes ⎕IO←0.


K4, 38 bytes


-1"c"$+(-t).q.rotate'32 65 97+/:t:!26;


q)k)-1"c"$+(-t).q.rotate'32 65 97+/:t:!26;


9 characters to perform the rotation...

-1"c"$+(-t).q.rotate'32 65 97+/:t:!26;
-1                                   ; / print to stdout, swallow return
                                  !26  / til 26, 0..25
                                t:     / save as variable t
                             +/:       / add each right item to...
                     32 65 97          / the list 32, 65, 97 (ASCII offsets)
           .q.rotate'                  / rotate each-both
       (-t)                            / negate, 0..-25
      +                                / flip rows and columns
  "c"$                                 / cast to characters

Perl, 49 46 bytes

perl -E 'say map chr($_*55%81)=~y// -:A-Z             


perl -E 'say grep{$_=chr$_*55%81;y// -:A-Z             
  • \$\begingroup\$ +1! I can't help you save any bytes back, but I wondered about using $^x8, but can't think of another var with enough length, perhaps "@INC" but it's too long, and using "@-" instead of $n++, but still, same length. Unless that helps you shrink this further? Unless you add -p flag and have implicit output? \$\endgroup\$ – Dom Hastings Feb 14 '18 at 15:39
  • 1
    \$\begingroup\$ @DomHastings Ah, found a way to loop without needing so much preparation \$\endgroup\$ – Ton Hospel Feb 14 '18 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.