39
\$\begingroup\$

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

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

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

 !"#$%&'()*+,-./0123456789
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz

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

\$\endgroup\$
5
  • 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, 2018 at 18:03
  • 2
    \$\begingroup\$ @Tom no, it should maximum be one trailing newline \$\endgroup\$ Feb 14, 2018 at 19:10
  • \$\begingroup\$ Is a leading newline acceptable? \$\endgroup\$ Feb 15, 2018 at 8:42
  • \$\begingroup\$ @DomHastings No, sorry. \$\endgroup\$ Feb 15, 2018 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\$
    – DELETE_ME
    Feb 23, 2018 at 8:19

47 Answers 47

1
2
2
\$\begingroup\$

Perl, 49 46 bytes

perl -E 'say map chr($_*55%81)=~y// -:A-Z             
a-z       
/cr,0..79'

or

perl -E 'say grep{$_=chr$_*55%81;y// -:A-Z             
a-z       
/c}0..79'
\$\endgroup\$
2
  • \$\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\$ Feb 14, 2018 at 15:39
  • 1
    \$\begingroup\$ @DomHastings Ah, found a way to loop without needing so much preparation \$\endgroup\$
    – Ton Hospel
    Feb 14, 2018 at 22:27
2
\$\begingroup\$

Jelly, 16 bytes

“ Aa‘ṙ2‘$25СỌZY

Try it online!

-4 thanks to miles.

\$\endgroup\$
8
  • \$\begingroup\$ 19 bytes \$\endgroup\$
    – dylnan
    Feb 14, 2018 at 16:55
  • \$\begingroup\$ (I used LÐṀ instead of ḣ26 but there was no reason as it didn't save any bytes) \$\endgroup\$
    – dylnan
    Feb 14, 2018 at 16:57
  • \$\begingroup\$ @dylnan thanks, I'll update later \$\endgroup\$ Feb 14, 2018 at 16:57
  • \$\begingroup\$ 18 bytes \$\endgroup\$
    – dylnan
    Feb 14, 2018 at 17:09
  • \$\begingroup\$ 17 bytes sorry for the barrage \$\endgroup\$
    – dylnan
    Feb 14, 2018 at 17:14
2
\$\begingroup\$

Pip, 24 bytes

Requires -l flag.

Z:B@{-a+^012}ME Z[PAAZz]

Try it online!

Explanation

Z:B@{-a+^012}ME Z[PAAZz]
                          PA is string of all printable ASCII characters; AZ is uppercase
                          letters; z is lowercase letters (implicit)
                 [PAAZz]  Construct a list of those three strings
                Z         Zip (transpose), clipping PA to the length of the shorter two
             ME           Map-enumerate: apply the following function to the index (a) and
                          value (b) of each item in the list:
        ^012               Split 012 into a list of digits [0 1 2]
     -a+                   To each, add negative a
    {       }              Modify that function
  B@                       by using its return value to index into b
Z:                        Take the result of the map operation and zip it again
                          Print, each sublist concatenated on a separate line (-l flag)
\$\endgroup\$
2
\$\begingroup\$

SOGL V0.12, 15 bytes

 9ΔZz⁰I{∑ē⌡«}⁰H

Try it Here!

Explanation:

 9               push "9"
  Δ              range from " " to "9" (that 1st space has nothing to do with this)
   Zz            push the uppercase and lowercase alphabets
     ⁰           wrap those in an array
      I          and rotate clockwise
       {    }    for each item
        ∑          join the item together
         ē⌡        counter times
           «         rotate the string left
             ⁰   wrap that all in an array
              H  and rotate anti-clockwise
\$\endgroup\$
2
\$\begingroup\$

Perl 6,  76 57  55 bytes

$/=|120.comb;.put for [Z~] map *.[|$/.=rotate(-1)],[Z] ' '..~9,'A'..*,'a'..*

Try it

.put for [Z~] ((' Aa','a A','Aa ')».ords «+»^26)».chr

Try it

.put for [Z~] (<!Bb b!B Bb!>».ords «+»(^26-1))».chr

Try it

Explanation

( ' Aa', 'a A', 'Aa ' )».ords

  ( (32, 65, 97),    # ' Aa'.ords
    (97, 32, 65),    # 'a A'.ords
    (65, 97, 32), )  # 'Aa '.ords

(^26 is short for 0..^26 which is similar to 0..26-1)

… «+» ^26            # matrix add; extending both sides

  #   + line 1
  #   |    + line 2
  #   |    |    + line 3           +-------------+-------------+ repeat 0..25
  #   V    V    V                  V             V             V
  ( ( 32,  65,  97), # ( (.[0;0] + 0), (.[0;1] + 0), (.[0;2] + 0) ),# <+ repeat
    ( 98,  33,  66), # ( (.[1;0] + 1), (.[1;1] + 1), (.[1;2] + 1) ),#  | ' Aa'.ords
    ( 67,  99,  34), # ( (.[2;0] + 2), (.[2;1] + 2), (.[2;2] + 2) ),#  |
                                                                    #  |
    ( 35,  68, 100), # ( (.[0;0] + 3), (.[0;1] + 3), (.[0;2] + 3) ),# <+
    (101,  36,  69), # ( (.[1;0] + 4), (.[1;1] + 4), (.[1;2] + 4) ),#  |
    ( 70, 102,  37), # ( (.[2;0] + 5), (.[2;1] + 5), (.[2;2] + 5) ),#  |
                                                                    #  |
    ( 38,  71, 103), # ( (.[0;0] + 6), (.[0;1] + 6), (.[0;2] + 6) ),# <+
    (104,  39,  72), # ( (.[1;0] + 7), (.[1;1] + 7), (.[1;2] + 7) ),
    ( 73, 105,  40), # ( (.[2;0] + 8), (.[2;1] + 8), (.[2;2] + 8) ),
    … )
(…)».chr             # (…).deepmap(*.chr)

  #   + line 1
  #   |    + line 2
  #   |    |    + line 3
  #   V    V    V
  ( (' ', 'A', 'a'),
    ('b', '!', 'B'),
    ('C', 'c', '"'),
    ('#', 'D', 'd'),
    ('e', '$', 'E'),
    ('F', 'f', '%'),
    … )
[Z~] …               # reduce using zip meta-op combined with concat op
                     # (has effect of rotating 90°, and joining)

  ( ' bC#eF&hI)kL,nO/qR2tU5wX8z',
    "A!cD$fG'iJ*lM-oP0rS3uV6xY9",
    'aB"dE%gH(jK+mN.pQ1sT4vW7yZ', )
.put for …           # loop over them printing them with trailing newline
\$\endgroup\$
2
\$\begingroup\$

brainfuck, 121 115 bytes

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

Thanks to @JoKing for saving 6 bytes!

Try it online!

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

C (gcc) 59 58 55 bytes

t;f(i){for(;putchar(i++%27?t%26+" aA"[t++%3]:10)^90;);}

Reusable millions of times, until t oveflows

\$\endgroup\$
1
\$\begingroup\$

JavaScript (ES6), 85 bytes

_=>` bC#eF&hI)kL,nO/qR2tU5wX8z
A!cD$fG'iJ*lM-oP0rS3uV6xY9
aB"dE%gH(jK+mN.pQ1sT4vW7yZ`

f=_=>` bC#eF&hI)kL,nO/qR2tU5wX8z
A!cD$fG'iJ*lM-oP0rS3uV6xY9
aB"dE%gH(jK+mN.pQ1sT4vW7yZ`
o.innerText=f()
<pre id=o>

\$\endgroup\$
1
\$\begingroup\$

><>, 57 bytes

0 >::dd+%$3%3$-3%1+v
;v^?%+dd:+1o+,2*'A'<
> ^
?a
%o
3:
^<

Try it online!

\$\endgroup\$
1
  • 2
    \$\begingroup\$ 45 bytes. Remember that newlines cost bytes too! \$\endgroup\$
    – Jo King
    Feb 23, 2018 at 10:41
1
\$\begingroup\$

Python 3, 71 bytes

print(''.join(chr(b%3*65%97+b%26+32)+'\n'[25-b%26:]for b in range(78)))

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Yabasic, 88 bytes

An anonymous solution that takes no input and outputs to the console in text-graphics mode.

Note: the standard Yabasic host will place the message ---Program done, press RETURN--- over top the second line of output so a terminal line such as ?:? must be added to the end of the solution to push this message down by two or more lines.

Clear Screen
For c=0To 25
For r=0To 2
?@(c,Mod(r+c,3))Chr$(c-.5*r^2+33.5*r+32)
Next
Next

Output

enter image description here

Literal Solution, 86 bytes

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

Try it online!

\$\endgroup\$
1
\$\begingroup\$

><>, 38 bytes

>ldd+%3l3%-'A'*2,+ol0ld6*)?;ldd+%.
/ao

Try it online!

\$\endgroup\$
1
\$\begingroup\$

C (gcc), 108 103 102 bytes

f(j,k){for(k=1;k<4;k+=puts(""))for(j=0;j<26;)putchar(j+!(j%3-k+1)*32+!(~k%3+j%3)*65+!(j++%3-k%3)*97);}

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ @ceilingcat Thank you. \$\endgroup\$ May 20, 2020 at 9:54
  • \$\begingroup\$ @ceilingcat Thanks again. \$\endgroup\$ May 26, 2020 at 0:35
1
\$\begingroup\$

Vyxal 3 j, 17 bytes

kp½hkR+₂ẆTƛm(ṙ]T“

Try it Online!

I tried, no easy way to get codepoints so slicing builtins it is.

\$\endgroup\$
0
\$\begingroup\$

PHP, 74 bytes

for(;$a<78;$a++)echo$a%26?'':'
',chr($a%26+[32,65,97][(2*$a%52+$a/26)%3]);
\$\endgroup\$
0
\$\begingroup\$

Deadfish~, 803 bytes

{iii}iic{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{{d}}{d}ddc{iiiii}iiiiic{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{ddddd}iiic{{i}d}dddc{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc{ddd}ddc{iiiiii}iiiiiic{ddd}dc

Try it online!

\$\endgroup\$
0
\$\begingroup\$

JavaScript (Node.js), 62 bytes

f=(i=k=81)=>i--?Buffer([i%27?k--%3*32.5+58.5-i%27:10])+f(i):''

Try it online!

From Neil's solution

\$\endgroup\$
1
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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