36
\$\begingroup\$

Without taking any input, output this exact text:

                         A
                        B A
                       C B A
                      D C B A
                     E D C B A
                    F E D C B A
                   G F E D C B A
                  H G F E D C B A
                 I H G F E D C B A
                J I H G F E D C B A
               K J I H G F E D C B A
              L K J I H G F E D C B A
             M L K J I H G F E D C B A
            N M L K J I H G F E D C B A
           O N M L K J I H G F E D C B A
          P O N M L K J I H G F E D C B A
         Q P O N M L K J I H G F E D C B A
        R Q P O N M L K J I H G F E D C B A
       S R Q P O N M L K J I H G F E D C B A
      T S R Q P O N M L K J I H G F E D C B A
     U T S R Q P O N M L K J I H G F E D C B A
    V U T S R Q P O N M L K J I H G F E D C B A
   W V U T S R Q P O N M L K J I H G F E D C B A
  X W V U T S R Q P O N M L K J I H G F E D C B A
 Y X W V U T S R Q P O N M L K J I H G F E D C B A
Z Y X W V U T S R Q P O N M L K J I H G F E D C B A

Rules

  • Output can be given by any convenient method.
  • You can print it to STDOUT or return it as a function result.
  • Either a full program or a function are acceptable.
  • A single trailing newline is acceptable, but no other formatting changes are allowed.
  • Capital letters are required.
  • Standard loopholes are forbidden.
  • This is so all usual golfing rules apply, and the shortest code (in bytes) wins.
\$\endgroup\$
6
  • 2
    \$\begingroup\$ A single trailing newline is acceptable, but no other formatting changes are allowed. So a trailing space on each line would not be permitted? \$\endgroup\$
    – DJMcMayhem
    Oct 25, 2019 at 18:04
  • 2
    \$\begingroup\$ @DJMcMayhem Correct - no trailing spaces. Darn that rules out [char][space] times length, doesn't it? ;-) \$\endgroup\$ Oct 25, 2019 at 18:05
  • \$\begingroup\$ Can we return a list of strings? \$\endgroup\$ Oct 25, 2019 at 18:41
  • 2
    \$\begingroup\$ @NickKennedy Yes, that's fine. \$\endgroup\$ Oct 25, 2019 at 18:47
  • 1
    \$\begingroup\$ I like the 3d bump effect around the J. \$\endgroup\$ Oct 27, 2019 at 13:22

64 Answers 64

1
\$\begingroup\$

Icon, 84 bytes

procedure main()
s:="";i:=1to 26&s[1:1]:=" "||char(64+i)&write(right(s,25+i))&\z
end

Try it online!

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

Python 3, 78 bytes

for i in range(26):print(' '*(25-i)+' '.join(chr(65+i-j) for j in range(i+1)))

A straightforward solution.

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

Red, 76 bytes

a:""repeat n 26[insert a rejoin[sp#"@"+ n]print next pad/left copy a n + 26]

Try it online!

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

Perl 6, 33 bytes

{(' 'Xx(25...0))Z~[\R,] 'A'..'Z'}

Try it online!

Anonymous code block that returns a list of lines.

Explanation:

{                               }  # Anonymous code block
  ' 'Xx                            # String multiply spaces
       (25...0)                       # by the range 25 to 0
 (             )Z~                 # Zip these indents with
                  [\  ]               # The triangular reduced
                    R,                # Reversed list concatenation
                        'A'..'Z'      # Of the alphabet
\$\endgroup\$
1
\$\begingroup\$

C# (Visual C# Interactive Compiler), 81 bytes

var x="A";for(char y='\x41';++y<92;x=y+" "+x){WriteLine(new string(' ',91-y)+x);}

Try it online!

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

Keg 32 31 30 26 25 24 25 bytes (SBCS)

A(\≤|:Z$- ⅍*,:Aɧ∑, ,)⑨
,)

Try it online!

Hey, Keg's coming 9th (at the time of writing)! Contains unprintable characters. Uses the 26 byte approach but uses a space converted to a string to pad lines.

Answer History

25 bytes

A(|:Aɧ ⅍!3--*,∑, ,)1+
,

Try it online!

26 bytes (SBCS)

A(|:Aɧ(!;;-| ,)∑, ,)1+
,

-4 bytes by using stack mechanics rather than the register

Explained

A(␚|:Aɧ(␚!;;-| ,)∑, ,)1+¶,
A                           #Push "A" onto the stack
(␚|                         #26 times:
    :Aɧ                     #   Push a generated range from A to the top of stack
    (␚!;;-| ,)              #   Space-align the row
    ∑, ,)                   #   Print each character space seperated
    1+                      #   Increment the top letter by one
    ¶,                      #   Print a newline 

Substitute for the actual unprintable control key and for a literal newline

30 bytes (SBCS)

A&(|A&:&ɧ(!;-| ,)(, ,)&1+&
,

Explained

A&(␚|A&:&ɧ(␚!;-| ,)(, ,)&1+&¶,
A&                              #Put A in the register
  (␚|                           #26 times:
      A&:&ɧ                     #   Push a generated range from A to the top of stack
           (␚!;-| ,)            #   Space-align the row
                    (, ,)       #   Print each character space seperated
                         &1+&   #   Increment the top letter by one
                             ¶, #   Print a newline     

Substitute for the actual unprintable control key and for a literal newline

31 bytes (SBCS)

A&(\≤|A&:&ɧ(\≤!-| ,)(, ,)&1+&
,

Explained

A&(\≤|A&:&ɧ(\≤!-| ,)(, ,)&1+&¶,)
A&                              #Store A in the register
  (\≤|                          #26 times:
      A&:&ɧ                     #   Push a generated range from A to the top
           (\≤!-| ,)            #   Align it using spaces               
                    (, ,)       #   Print the row
                         &1+&   #   Increment the letter
                             ¶,)#   Print a newline (replace ¶ w/ \n)
\$\endgroup\$
0
1
\$\begingroup\$

R, 65 bytes

for(i in 1:26){cat(strrep(" ",26-i));cat(LETTERS[i:1]);cat("\n")}

Try it online!

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

J, 31 bytes

(|.@;:inv,~' '#~26-#)\u:65+i.26

Try it online!

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

Julia 1.0, 51 bytes

[' '^i*join(('Z'-i:-1:'B').*' ')*'A' for i=25:-1:0]

Try it online!

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

APL (Dyalog Extended), 22 bytes

(⌽0,⍳25)⌽⌽↑{∊⍺' '⍵}\⎕A

Try it online!

Output of above function.

Explanation:

  • ⎕A is the uppercase alphabet character vector.
  • {∊⍺' '⍵} is a 1 character shorter version of {⍺,' ',⍵} which puts a space between arguments and .
  • Reducing / this function over ⎕A would result in the uppercase alphabet with spaces between, 'A B C ...'. Scanning \ instead produces a nested vector of all the intermediate results, ('A') ('A B') ('A B C')....
  • Mix turns the nested vector into a matrix, padding rows to equal length with spaces, which is then horizontally mirrored with (the one on the right).
  • To get the final answer we need to rotate the rows (dyadic ) by 25, 24, 23, ... 0 characters.
  • The left argument to the rotation is the sequence 25, 24, 23, ... 0, which is obtained concisely by ⌽0,⍳25.
\$\endgroup\$
1
\$\begingroup\$

Batch, 144 bytes

Abuses token delimiters ([ and ;)

@!! 2>nul||cmd/q/v/c%0&&exit/b
set;=for /l %%A in (65 1 90)do set[=
%;% ![!
%;%![:~,-1!&cmd/cexit %%A&set]=!=exitcodeascii! !]!&echo(![!!]:~,-1!

Sources

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

Deadfish~, 10394 bytes

{i}{i}{i}ii{c}{c}ccccc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}{c}cccc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}{c}ccc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}{c}cc{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}{c}c{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}{c}{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}ccccccccc{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}cccccccc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}ccccccc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}cccccc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}ccccc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}cccc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}ccc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}cc{{i}dddddd}iiiiiic{{d}iiiiii}ddddddc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}c{{i}ddddd}dddc{{d}iiiii}iiic{{i}dddddd}iiiiiic{{d}iiiiii}ddddddc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}ii{c}{{i}ddddd}ddc{{d}iiiii}iic{{i}ddddd}dddc{{d}iiiii}iiic{{i}dddddd}iiiiiic{{d}iiiiii}ddddddc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}iiccccccccc{{i}ddddd}dc{{d}iiiii}ic{{i}ddddd}ddc{{d}iiiii}iic{{i}ddddd}dddc{{d}iiiii}iiic{{i}dddddd}iiiiiic{{d}iiiiii}ddddddc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}iicccccccc{{i}ddddd}c{{d}iiiii}c{{i}ddddd}dc{{d}iiiii}ic{{i}ddddd}ddc{{d}iiiii}iic{{i}ddddd}dddc{{d}iiiii}iiic{{i}dddddd}iiiiiic{{d}iiiiii}ddddddc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}iiccccccc{{i}ddddd}ic{{d}iiiii}dc{{i}ddddd}c{{d}iiiii}c{{i}ddddd}dc{{d}iiiii}ic{{i}ddddd}ddc{{d}iiiii}iic{{i}ddddd}dddc{{d}iiiii}iiic{{i}dddddd}iiiiiic{{d}iiiiii}ddddddc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}iicccccc{{i}ddddd}iic{{d}iiiii}ddc{{i}ddddd}ic{{d}iiiii}dc{{i}ddddd}c{{d}iiiii}c{{i}ddddd}dc{{d}iiiii}ic{{i}ddddd}ddc{{d}iiiii}iic{{i}ddddd}dddc{{d}iiiii}iiic{{i}dddddd}iiiiiic{{d}iiiiii}ddddddc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}iiccccc{{i}ddddd}iiic{{d}iiiii}dddc{{i}ddddd}iic{{d}iiiii}ddc{{i}ddddd}ic{{d}iiiii}dc{{i}ddddd}c{{d}iiiii}c{{i}ddddd}dc{{d}iiiii}ic{{i}ddddd}ddc{{d}iiiii}iic{{i}ddddd}dddc{{d}iiiii}iiic{{i}dddddd}iiiiiic{{d}iiiiii}ddddddc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}iicccc{{i}ddddd}iiiic{{d}iiiii}ddddc{{i}ddddd}iiic{{d}iiiii}dddc{{i}ddddd}iic{{d}iiiii}ddc{{i}ddddd}ic{{d}iiiii}dc{{i}ddddd}c{{d}iiiii}c{{i}ddddd}dc{{d}iiiii}ic{{i}ddddd}ddc{{d}iiiii}iic{{i}ddddd}dddc{{d}iiiii}iiic{{i}dddddd}iiiiiic{{d}iiiiii}ddddddc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}iiccc{{i}ddddd}iiiiic{{d}iiiii}dddddc{{i}ddddd}iiiic{{d}iiiii}ddddc{{i}ddddd}iiic{{d}iiiii}dddc{{i}ddddd}iic{{d}iiiii}ddc{{i}ddddd}ic{{d}iiiii}dc{{i}ddddd}c{{d}iiiii}c{{i}ddddd}dc{{d}iiiii}ic{{i}ddddd}ddc{{d}iiiii}iic{{i}ddddd}dddc{{d}iiiii}iiic{{i}dddddd}iiiiiic{{d}iiiiii}ddddddc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}iicc{{i}ddddd}iiiiiic{{d}iiiii}ddddddc{{i}ddddd}iiiiic{{d}iiiii}dddddc{{i}ddddd}iiiic{{d}iiiii}ddddc{{i}ddddd}iiic{{d}iiiii}dddc{{i}ddddd}iic{{d}iiiii}ddc{{i}ddddd}ic{{d}iiiii}dc{{i}ddddd}c{{d}iiiii}c{{i}ddddd}dc{{d}iiiii}ic{{i}ddddd}ddc{{d}iiiii}iic{{i}ddddd}dddc{{d}iiiii}iiic{{i}dddddd}iiiiiic{{d}iiiiii}ddddddc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{i}{i}iic{{i}dddd}dddc{{d}iiii}iiic{{i}ddddd}iiiiiic{{d}iiiii}ddddddc{{i}ddddd}iiiiic{{d}iiiii}dddddc{{i}ddddd}iiiic{{d}iiiii}ddddc{{i}ddddd}iiic{{d}iiiii}dddc{{i}ddddd}iic{{d}iiiii}ddc{{i}ddddd}ic{{d}iiiii}dc{{i}ddddd}c{{d}iiiii}c{{i}ddddd}dc{{d}iiiii}ic{{i}ddddd}ddc{{d}iiiii}iic{{i}ddddd}dddc{{d}iiiii}iiic{{i}dddddd}iiiiiic{{d}iiiiii}ddddddc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic{{d}iiiii}dddddc{{i}dd}c{{d}iiii}iic{{i}dddd}dddc{{d}iiii}iiic{{i}ddddd}iiiiiic{{d}iiiii}ddddddc{{i}ddddd}iiiiic{{d}iiiii}dddddc{{i}ddddd}iiiic{{d}iiiii}ddddc{{i}ddddd}iiic{{d}iiiii}dddc{{i}ddddd}iic{{d}iiiii}ddc{{i}ddddd}ic{{d}iiiii}dc{{i}ddddd}c{{d}iiiii}c{{i}ddddd}dc{{d}iiiii}ic{{i}ddddd}ddc{{d}iiiii}iic{{i}ddddd}dddc{{d}iiiii}iiic{{i}dddddd}iiiiiic{{d}iiiiii}ddddddc{{i}dddddd}iiiiic{{d}iiiiii}dddddc{{i}dddddd}iiiic{{d}iiiiii}ddddc{{i}dddddd}iiic{{d}iiiiii}dddc{{i}dddddd}iic{{d}iiiiii}ddc{{i}dddddd}ic{{d}iiiiii}dc{{i}dddddd}c{{d}iiiiii}c{{i}dddddd}dc{{d}iiiiii}ic{{i}dddddd}ddc{{d}iiiiii}iic{{i}dddddd}dddc{{d}iiiiii}iiic{i}{i}{i}iiiiiic{d}{d}{d}ddddddc{i}{i}{i}iiiiic{d}{d}{d}dddddc{i}{i}{i}iiiic{d}{d}{d}ddddc{i}{i}{i}iiic

Compared to others, terrible!

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

R, 52 bytes

write(intToUtf8(outer(26:1,1:26,"<=")*90:65,T),1,26)

Try it online!

A different and (for now) golfier approach than this or that R answers.

To generate "exact text" as is required in challenges, there are usually two options in R: cat and write. cat is more flexible, as write is actually a wrapper around cat, but the advantage of write is that if you can construct your data in a rectangular (matrix) form, some of the verbosity of cat goes away, for instance, you get a newline without explicitly including it as you do in cat, which will then include an extra separator argument, which is usually undesirable. Since each line of the text here appears to be of variable width, write is not the first thing that comes to mind, and both of the other R answers are quite creative in getting around the shortcomings of cat. In particular, the fill argument is not one I'm familiar with, but will have to keep trying out.

The trick here is that write, like cat, separates elements by spaces. Since every line has the same number of spaces, if we can construct the right matrix of empty strings "" and capital letters, we can just use write to automatically put the spaces where they go.

My first attempt started by constructing the matrix directly:

R, 63 bytes

m=matrix(LETTERS,26,26);m[lower.tri(m)]="";write(m[26:1,],1,26)

Try it online!

This builds up a matrix of capital letters, then sets the lower triangle to empty strings, and finally flips vertically since write proceeds down the columns.

This is equally as long as Bart-Jan van Rossum's answer; I was going to post it since the approach was different, but when I went to read a comment on another completely unrelated challenge, I thought to try intToUtf8 instead.

Two things make this possible. Typically, intToUtf8 takes a vector of integers and converts them to a single string made up of their utf8 codepoints. There is also an optional argument, usually FALSE that when set to TRUE will instead return a vector of characters of the utf8 codepoints. The other trick is that intToUtf8(0) returns the empty string. So instead of constructing a matrix of "" and LETTERS, I constructed a matrix of codepoints, which ended up (finally) being shorter than the other R answers:

R, 61 bytes

write(intToUtf8((outer(1:26,1:26,"<=")*65:90)[26:1,],T),1,26)

Try it online!

Luckily, despite intToUtf8 returning a vector, write takes a ncolumns argument to specify how many columns wide it ought to be, which provides enough structure for write to print it correctly.

Finally, there are a couple of inefficient golfs which bring it to its current 52 byte form.

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

Brainfuck, 189 bytes

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

Try It Online!

(Using 8-bit wrapping)

I cannot put into words how much I hate this language.

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

Zsh, 46 43 bytes

-3 bytes from @pxeger using eval instead of a for loop

eval a={A..Z}'\ $a;echo ${(l:26+i++:)a%?};'

Try it online!

The eval expands to:

a=A\ $a;echo ${(l:26+i++:)a%?}; a=B\ $a;echo ${(l:26+i++:)a%?}; ...

Which is the same as the for loop from the second 46-byte solution below:


Originals:

for c ({A..Z})a=($c $a)&&echo ${(l:25-i++:)}$a

Try it online!

Abuses arrays implicitly joining on spaces. l:expr: pads on the left with spaces until at expr characters wide. Putting parameter expansion flags with no parameter like this causes them to operate on an empty string.


Alternate 46 byte solution, using a string with ${a%postfixremoval} instead. Note that here we increment the padding width to accommodate the growing total string length.

for c ({A..Z})a=$c\ $a&&echo ${(l:26+i++:)a%?}

Try it online!

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

JavaScript (Node.js),  65  63 bytes

Saved 2 bytes thanks to @l4m2

f=(n=26,s=`A
`)=>n--?''.padEnd(n)+s+f(n,Buffer([91-n,32])+s):''

Try it online!


JavaScript (Node.js), 79 bytes

More maths, more bytes.

f=(x=y=0)=>y<26?Buffer([x<y+26?y+x++&x>25-y?156-x+y>>1:32:(x=!++y,13)])+f(x):''

Try it online!

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

Vyxal j, 10 bytes

kA¦RvṄøĊøR

Try it Online!

Very nice

Explained (old)

₄ƛkAẎṘṄ
₄ƛ        # over the range [1, 26]: (call each item n)
  kAẎ     #     push "ABCDE....XYZ"[0:n]
     ṘṄ   #     reverse and join on spaces
          # the -C flag auto-centers the top of the stack 
\$\endgroup\$
3
0
\$\begingroup\$

Jelly, 16 bytes

L26_⁶x;KU$
ØAÇƤY

Try it online!

This seems too long for Jelly, despite being terrible at challenges

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

Haskell, 63 bytes

[(' '<$[c..'Y'])++foldl(\s->(:' ':s))"A"['B'..c]|c<-['A'..'Z']]

Try it online!

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

Japt, 29 bytes

;1o27@Bt0X)w)ò1)qS)ùS25+X})qR

Try it online!

\$\endgroup\$
3
  • \$\begingroup\$ This can be done in 11 bytes ;) Hint: it involves cumulative reduction. \$\endgroup\$
    – Shaggy
    Oct 26, 2019 at 1:37
  • \$\begingroup\$ @Shaggy Did I get your 11 byte solution? \$\endgroup\$
    – Gymhgy
    Oct 26, 2019 at 5:44
  • \$\begingroup\$ Seeing as @EmbodimentofIgnorance got that, you can still golf this one to 17 bytes \$\endgroup\$
    – Shaggy
    Oct 26, 2019 at 9:30
0
\$\begingroup\$

PHP, 59 bytes

for($a=A;$i++<26;)echo str_pad('',26-$i),$s=$a++." $s","
";

Try it online!

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

Wren, 125 119 bytes

Not very interesting until I read other answers.

for(i in 0..25){
System.write(" "*(25-i))
for(j in 0..i)System.write(" "+String.fromCodePoint(65+i-j))
System.print()
}

Try it online!

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

Elixir, 70 bytes

r=90..65;for i<-0..25,do: IO.puts for j<-r,do: 65+i-j>-1&&[j,' ']||' '

Try it here

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

Javascript ES6, 105 bytes

[..."ZYXWVUTSRQPONMLKJIHGFEDCBA"].forEach((l,i,a)=>console.log(" ".repeat(25-i)+a.slice(25-i).join(" ")))

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

sed 4.2.2 (with GNU exec extension), 58 bytes

s/^/bash -c 'echo {Z..A}'/e
:
s/^( *)\S([^\n]+)/\1\2\n&/
t

Try it online!


Pure sed 4.2.2, 71 bytes

s/^/ZYXWVUTSRQPONMLKJIHGFEDCBA/
s/\B/ /g
:
s/^( *)\S([^\n]+)/\1\2\n&/
t

Try it online!

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

Perl 5, 30 bytes

$b[26+--$i]=$_,say"@b"for A..Z

Try it online!

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

Python 3, 133 130 125 123 122 bytes

Not the shortest, but I wanted to try to make the output one single string

print('\n'.join((25-len(v)//2)*' '+v for v in(''.join(" "+chr(i)for i in range(90,64,-1))[i:52]for i in range(51,-1,-2))))

Try it online!

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

Jelly, 12 bytes

ØAa⁶ḊÐƤżKƤUY

A full program which prints the result

Try it online!

How?

ØAa⁶ḊÐƤżKƤUY - Main Link: no arguments
ØA           - (set left to) uppercase alphabet  say:['A','B','C']
   ⁶         - space character                       ' '
  a          - AND (vectorises)                      [' ',' ',' ',]
     ÐƤ      - for postfixes:
    Ḋ        -   dequeue                             [[' ',' '],[' '],[]]
         Ƥ   - for prefixes (of left=alphabet):
        K    -   join with spaces                    [['A'],['A',' ','B'],['A',' ','B',' ','C']]
       ż     - zip together                          [[[' ',' '],['A']],[[' '],['A',' ','B']],[[],['A',' ','B',' ','C']]]
          U  - upend                                 [[[' ',' '],['A']],[[' '],['B',' ','A']],[[],['C',' ','B',' ','A']]]
           Y - join with newlines                    [[' ',' '],['A'],'\n',[' '],['B',' ','A'],'\n',[],['C',' ','B',' ','A']]
             - implicit, smashing print >>>  A
             -                          >>> B A
             -                          >>>C B A 
\$\endgroup\$
0
\$\begingroup\$

C, 83 82 bytes

(−1 golfing thanks to ceilingcat)

main(c){for(char s[99]="",*t=s+98;*--t=c+64,printf("%*s\n",c+++25,t)<52;*--t=32);}

Builds the final string from end to beginning, printing all the unfinished versions.

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

Stax, 11 bytes

ùivK‼9⌂m¬╚─

Run and debug it

\$\endgroup\$

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.