77
\$\begingroup\$

Inspired by a bug in a solution to this challenge, your challenge is to produce this exact text:

                         ZYXWVUTSRQPONMLKJIHGFEDCBA
                        YXWVUTSRQPONMLKJIHGFEDCBA
                       XWVUTSRQPONMLKJIHGFEDCBA
                      WVUTSRQPONMLKJIHGFEDCBA
                     VUTSRQPONMLKJIHGFEDCBA
                    UTSRQPONMLKJIHGFEDCBA
                   TSRQPONMLKJIHGFEDCBA
                  SRQPONMLKJIHGFEDCBA
                 RQPONMLKJIHGFEDCBA
                QPONMLKJIHGFEDCBA
               PONMLKJIHGFEDCBA
              ONMLKJIHGFEDCBA
             NMLKJIHGFEDCBA
            MLKJIHGFEDCBA
           LKJIHGFEDCBA
          KJIHGFEDCBA
         JIHGFEDCBA
        IHGFEDCBA
       HGFEDCBA
      GFEDCBA
     FEDCBA
    EDCBA
   DCBA
  CBA
 BA
A
  • The first line will have 25 spaces, then the alphabet backwards starting from the 26th letter (ZYXWVUTSRQPONMLKJIHGFEDCBA), then a newline.
  • The second line will have 24 spaces, then the alphabet backwards starting from the 25th letter (YXWVUTSRQPONMLKJIHGFEDCBA), then a newline.
  • ...
  • The last (26th) line will have no spaces, then the alphabet backwards starting from the 1st letter (A), then a newline.

Additional rules:

  • Your program may use any allowed output methods.
  • One trailing newline and/or one leading newline is allowed.
  • There must be one newline between lines containing the letters, no more.
  • The letters must be all uppercase.

As with , the shortest submission wins. Good luck!

Leaderboard:

var QUESTION_ID=141725,OVERRIDE_USER=61563;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>

\$\endgroup\$
7
  • 4
    \$\begingroup\$ To me it looks like the light cast by the bat-signal \$\endgroup\$
    – scottinet
    Commented Sep 5, 2017 at 19:47
  • 4
    \$\begingroup\$ Closely Related. \$\endgroup\$
    – Mr. Xcoder
    Commented Sep 5, 2017 at 20:26
  • \$\begingroup\$ Can each line have an extra space in front of it? \$\endgroup\$
    – hyperneutrino
    Commented Sep 5, 2017 at 20:35
  • 3
    \$\begingroup\$ Could each line have trailing spaces after the last letter? \$\endgroup\$
    – miles
    Commented Sep 5, 2017 at 20:49
  • 1
    \$\begingroup\$ @miles yes, that's fine. \$\endgroup\$
    – MD XF
    Commented Sep 5, 2017 at 21:34

121 Answers 121

1
\$\begingroup\$

SpecBAS - 89 bytes

1 s=25,a$="ZYXWVUTSRQPONMLKJIHGFEDCBA"
2  ?" "*s;a$
3 a$=a$(2 TO),s-=1
4 IF s>0 THEN 2
5  ?a$

Bit of string splicing, rinse and repeat

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

C# (.NET Core), 87 + 18 bytes

_=>new int[26].Select((x,i)=>"ZYXWVUTSRQPONMLKJIHGFEDCBA".Substring(i).PadLeft(51-2*i))

Also included in byte count:

using System.Linq;

Try it online!

This outputs a collection of strings (for each line).

Explanation:

_ =>                                   // A function that takes one argument (unused)
    new int[26].                       // Create new collection size 26
    Select((x, i) =>                   // Replace every member with
        "ZYXWVUTSRQPONMLKJIHGFEDCBA"   //    Our alphabet
        .Substring(i)                  //    Take it's part based on line number
        .PadLeft(51 - 2 * i)           //    Add spaces to the left
    )

Here's non-kolmogorov version (for any string) - 76 + 18 bytes:

a=>new int[a.Length].Select((x,i)=>a.Substring(i).PadLeft(a.Length*2-1-2*i))

Try it online!

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

Perl 6, 44 bytes

$_=chrs 32 xx 27,91...65;.say while s/\s\S//

Try it online!

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

QBIC, 48 bytes

[26|Q=Q+chr$(a+64)][26,1,-1|?space$(b)+_s_fQ|,-b

Explanation

[26|            FOR a = 1; a <= 26; a++
Q=Q+chr$(a+64)  Add to Q$ a chr() being a+64 (A-Z in succession)
]               NEXT (at the end of the loop, Q$ is ABC...XYZ)
[26,1,-1|       FOR b = 26; b >= 1; b--
?space$(b)      PRINT b spaces,
+_s             and a substring of
   _fQ|         Q$ reversed,
   ,-b          taking b characters from the right
\$\endgroup\$
1
\$\begingroup\$

VB, 167 bytes

i = 26

For a = i To 1 Step -1
    For j = a To 1 Step -1
        c = c + "  "
        b = b + Chr(64 + j)
    Next
    
    d = d & c & b & vbNewLine
    c = ""
    b = ""
Next
msgbox d

first time to participate but i'm not competing to everyone, just myself. lol

\$\endgroup\$
6
  • 2
    \$\begingroup\$ Welcome to PPCG! I am not sure about VB, but can you remove the whitespace, like b=b+Chr(64+j)? That would save quite a bit here. \$\endgroup\$
    – JAD
    Commented Sep 6, 2017 at 8:11
  • \$\begingroup\$ @JarkoDubbeldam VB automatically adds spaces when programming in an IDE. I don't think they're required, though. I've seen confusion before about whether to remove them or ignore them. \$\endgroup\$
    – mbomb007
    Commented Sep 6, 2017 at 14:13
  • \$\begingroup\$ @mbomb007 hmm, can you run VB from a file without opening it in an IDE? \$\endgroup\$
    – JAD
    Commented Sep 6, 2017 at 14:20
  • \$\begingroup\$ @JarkoDubbeldam When I deal with Basic's auto-indentation, I usually open a separate text editor, remove as much whitespace as possible, then paste that into the IDE. If auto-format still works and the code runs as expected, I post the code from the text editor. \$\endgroup\$
    – steenbergh
    Commented Sep 6, 2017 at 14:40
  • 2
    \$\begingroup\$ Welcome to PPCG :) Following on from the other suggestions, there's plenty that can be golfed out of this. Here's a quick pass I took over it for 103 bytes: for a=26to 1step-1:c="":b="":for j=a to 1step-1:c=c+" ":b=b+chr(64+j):next:d=d&c&b&vbcrlf:next:msgbox d \$\endgroup\$
    – Shaggy
    Commented Sep 6, 2017 at 16:47
1
\$\begingroup\$

DUP, 48 bytes

25 65[^[$][32,1-]#%^^+[^^\-][$,1-]#,10,^][\1-\]#

Online DUP interpreter

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

Octave, 38 bytes (or 46 bytes in tio)

flip([spdiags(hankel(90:-1:65)) '']')'

Generates the correct output at least on windows installation of Octave, but in tio to be correctly shown the character 0 should be replace by space:

[max(32,flip(spdiags(hankel(90:-1:65))')') '']

Try it online!

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

Perl 6, 57 bytes

.put for (' 'Xx(25...0))Z~(('Z'...'A') »...»'A')».join

Try it online!

Expanded:

  .put              # print with trailing newline

for                 # for each of the following

  (
      ' ' 

    Xx              # cross using string repetition operator

      ( 25 ... 0 )  # from 25 down to 0
  )

  Z~                # zip using string concatenation

  (
    ( 'Z' ... 'A' ) # descending sequence of starting values
    »...»           # combine those into sequences each with an end value of 'A'
    'A'
  )».join           # combine each of the sub sequences into strings
\$\endgroup\$
1
\$\begingroup\$

Clojure v1.8, 93 bytes

Converted Renzo's answer to Clojure.

(dotimes[i 26](prn(apply str(concat(repeat(- 25 i)" ")(subs"ZYXWVUTSRQPONMLKJIHGFEDCBA"i)))))

Explanation

(dotimes [i 26] ...)                 We will print 26 lines, i is between[0, 26)
(subs"ZYXWVUTSRQPONMLKJIHGFEDCBA"i)  Take the string starting from position 'i'
(repeat(- 25 i)" ")                  Repeat the whitespaces, we start from 25 because the last line doesn't have whitespaces
(prn(apply str(concat(repeat(- 25 i)" ")(subs"ZYXWVUTSRQPONMLKJIHGFEDCBA"i)))) Concatenate the sequence of whitespaces and the string in order to have the desired effect with 'str' next

Try it online!

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

brainfuck, 119 bytes

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

Try it online!

Could be golfable by better initializing the tape - there is a modulo solution that would pop 90,32,26 and 10, that would also probably leave the tape a little less fragmented.

Also could combine all three loops unto one, by juggling the index as the difference from the ASCII code 'Z', or something.

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

Javascript, 82 bytes

for(i=26;i;){console.log(" ".repeat(i-1)+"ZYXVUTSRQPONMLKJIHGFEDCBA".slice(-i--))}

Try it online!

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

Twig, 93 bytes

Twig is a template language developed to be used in PHP, which is similar to Smarty, Django or Jinja.

{%for a in "Z".."A"%}{{("%"~(26-loop.index)~"s%s")|format(f,range(a,"A")|join())}}
{%endfor%}

This code relies in the fact that the environment option strict_variables defaults to false. Otherwise, it will break.

Try it on https://twigfiddle.com/9umogr (check the raw result).
If you want to copy-paste the code, make sure that you disable strict_variables, since the website sets that to true.

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

Bash + coreutils, 64 bytes

printf '%s' {Z..A}|sed 'h;s/./ /g;G;s/ \n//;p;:a;s/ \b.//p;ta;Q'
\$\endgroup\$
2
  • \$\begingroup\$ I like this, but it seems to be missing the newline at the end. \$\endgroup\$ Commented Sep 8, 2017 at 1:36
  • \$\begingroup\$ I guess the requirements were a bit unclear. \$\endgroup\$ Commented Sep 8, 2017 at 2:04
1
\$\begingroup\$

C, 82 characters

char*a="ZYXWVUTSRQPONMLKJIHGFEDCBA\n",i=54;main(){while(i)printf("%*s",i-=2,a++);}

Works for any character coding, by embedding the full alphabet. We print subsequent trailing substrings in a field twice as wide as required, to get the leading spaces.

I had hoped to be able to reduce it further with while(printf());, but couldn't arrange for the return value to reach zero at the right point.

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

Retina, 38 bytes


25$* Z
{-2=`
$'
}T`L`_L`.$
;{:G`
 \w

Try it online!

Explanation


25$* Z

Initialise the working string to 25 spaces and a single Z.

{-2=`
$'
}T`L`_L`.$

The usual approach for generating the alphabet: repeatedly duplicate the last letter, then decrement that letter with a transliteration, removing As instead of decrementing them further. That means once we get to A, the second stage will delete the letter which was added by the first stage, so there won't be any net change and the loop stops. That gives us the first line of the output.

;{:G`
 \w

Now we really just repeatedly print the current line and the drop a space followed by a letter. The construction is slightly weird due to how loops and printing works in Retina. We need to print before we drop the letter, which requires a separate stage that otherwise doesn't do anything, and we also need to disable the implicit printing at the end of the program.

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

Husk, 15 bytes

mṠ+ȯR' ←Lhṫ…"ZA

Try it online!

-5 thanks to Zgarb. Still a newb :p

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

Pyth, 14 bytes

-2 from dave and ven thanks guys

V_UG+*dNrG1=PG

Explanation coming when I figure it out wake up.

Pyth, 16 bytes

V26p*-25Nd>_rG1N

Explanation:

V26        26 times, could've written lG, but it's the same
   p*-25Nd Print without newline: 25-index spaces (could've used + instead of p but it's simpler to explain)
   >_rG1N  Implicit print with newline: The last index characters of the reverse uppercase alphabet

Try it online!

While you're here, here's Artemis's first answer ported into Pyth:

Pyth, 21 20 bytes (non-competing)

J26W=tJ+*dJ>_rG1-25J

An explanation for Artemis's answer:

J26        Set J to 26
W          While...
 =tJ       Decrement J (J-=1)
 +*dJ      J spaces plus...
 >_rG1-25J The last 25-index characters of the reverse uppercase alphabet

I should stop writing these on my phone

Try it online!

\$\endgroup\$
5
  • \$\begingroup\$ Similar to this answer, but > doesn't seem like the way to go. How about setting G to tG, as in V_UG+*dNrG1=tG for 14 bytes? \$\endgroup\$
    – Dave
    Commented Sep 7, 2017 at 3:13
  • \$\begingroup\$ @Dave similar to what answer? \$\endgroup\$
    – Stan Strum
    Commented Sep 7, 2017 at 3:16
  • \$\begingroup\$ Yours! This being parent lol \$\endgroup\$
    – Dave
    Commented Sep 7, 2017 at 3:16
  • \$\begingroup\$ @Dave I knew I was doing something wrong \$\endgroup\$
    – Stan Strum
    Commented Sep 7, 2017 at 3:17
  • \$\begingroup\$ It's too early for this \$\endgroup\$
    – Stan Strum
    Commented Sep 7, 2017 at 15:11
1
\$\begingroup\$

Java, 206 bytes

public class Main{public static void main(String[]args){int i,j,k,l=90;for(k=26;k>=0;k--){for(i=k-1;i>0;i--){System.out.print(" ");}for(j=l;j>=65;j--){System.out.print((char)j);}l--;System.out.println();}}}

Try it online!

\$\endgroup\$
4
  • \$\begingroup\$ I'm new so not familiar how to add a post, hope to help someone.!! :D \$\endgroup\$
    – Akhil KC
    Commented Sep 8, 2017 at 10:40
  • 1
    \$\begingroup\$ Also, the bytecount must be visible on the header. \$\endgroup\$ Commented Sep 8, 2017 at 11:06
  • \$\begingroup\$ its actually shorter to define an interface than class. also, the args array doesn't have to be called args, can be let's say a as well. \$\endgroup\$
    – peech
    Commented Sep 8, 2017 at 15:48
  • \$\begingroup\$ You can use public class M to save three bytes. And String[]a to save three more. \$\endgroup\$
    – MD XF
    Commented Sep 8, 2017 at 16:16
1
\$\begingroup\$

Java, 196 134 bytes

Yes, this has no chance of winning overall, but it helps to re-familiarize myself with the language. Any improvements are welcome, but know I have not yet had time to read the Tips or Golfing in Java.

public class A{public static void main(String[]a){for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)System.out.print(" ");for(char c=(char)(90-i);c>=65;c--)System.out.print(c);System.out.println();}}}

Thanks to JollyJoker for suggesting improvements. I won't get a chance to investigate lambdas for this one, but I'll remember it for the future. This is as short as I'll make this one. Eclipse kept complaining when I changed all ints to chars, so I'll look into that some more.

String a(){String r="";for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)r+=" ";for(char c=(char)('Z'-i);c>=65;c--)r+=c;r+="\n";}return r;}

Try it online!

Ungolfed:

public class A { public static void main(String[] args) { for (int i = 0; i < 26; i++) { for (int j = 0; j < 25 - i; j++) System.out.print(" "); for (char c = (char)(90 - i); c> = 65; c--) System.out.print(c); System.out.println(); } } }

String a() {
    String r = "";
    for (int i = 0; i < 26; i++) {
        for (int j = 0; j < 25 - i; j++)
            r += " ";
        for (char c = (char)('Z'-i); c >= 65; c--)
            r += c; r+= "\n";
    }
    return r;
}
\$\endgroup\$
8
  • \$\begingroup\$ You can give the answer as a method returning a String instead of a full program. Use Java 8 lambdas for the method. Combine nested for loops if you can find a way. The char 32 is space and 10 is newline; concatenate chars like ""+=c to build a String. \$\endgroup\$
    – JollyJoker
    Commented Sep 7, 2017 at 11:59
  • \$\begingroup\$ You can use n-> instead of ()-> even if there's no input. Using it to store a char inside the code might be ok. \$\endgroup\$
    – JollyJoker
    Commented Sep 7, 2017 at 12:34
  • \$\begingroup\$ Thanks for the tips! I'll edit my answer in a few hours with your improvements. \$\endgroup\$ Commented Sep 7, 2017 at 12:46
  • \$\begingroup\$ You can copy / paste some lambda boilerplate from here \$\endgroup\$
    – JollyJoker
    Commented Sep 7, 2017 at 12:51
  • \$\begingroup\$ Avoid cast by using 'Z' instead of 90 and changing everything from int to char \$\endgroup\$
    – JollyJoker
    Commented Sep 7, 2017 at 13:14
1
\$\begingroup\$

VBA, 65 Bytes

Anonymous VBE immediate window function that takes no input and outputs to the VBE immediate window

For i=0To 25:?Spc(25-i);:For j=0To 25-i:?Chr(90-j-i);:Next:?:Next

Naïve Version, 68 Bytes

For i=0To 25:?Spc(25-i)Right("ZYXWVUTSRQPONMLKJIHGFEDCBA",26-i):Next
\$\endgroup\$
1
\$\begingroup\$

Python 2, 86 83 bytes

for x in range(25,-1,-1):print(" "*x)+"".join([chr(y+65)for y in range(x+1)][::-1])

Thanks to Stephen for the 3 extra bytes.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ 3? less bytes by removing extra spaces: for x in range(25,-1,-1):print(" "*x)+"".join([chr(y+65)for y in range(x+1)][::-1]) \$\endgroup\$
    – Stephen
    Commented Sep 6, 2017 at 23:11
1
\$\begingroup\$

q/kdb+, 32 31 bytes

Solution:

raze@/:(1_')\[(25#" ";(|).Q.A)]

Example:

q)raze@/:(1_')\[(25#" ";(|).Q.A)]
"                         ZYXWVUTSRQPONMLKJIHGFEDCBA"
"                        YXWVUTSRQPONMLKJIHGFEDCBA"
"                       XWVUTSRQPONMLKJIHGFEDCBA"
"                      WVUTSRQPONMLKJIHGFEDCBA"
"                     VUTSRQPONMLKJIHGFEDCBA"
"                    UTSRQPONMLKJIHGFEDCBA"
"                   TSRQPONMLKJIHGFEDCBA"
"                  SRQPONMLKJIHGFEDCBA"
"                 RQPONMLKJIHGFEDCBA"
"                QPONMLKJIHGFEDCBA"
"               PONMLKJIHGFEDCBA"
"              ONMLKJIHGFEDCBA"
"             NMLKJIHGFEDCBA"
"            MLKJIHGFEDCBA"
"           LKJIHGFEDCBA"
"          KJIHGFEDCBA"
"         JIHGFEDCBA"
"        IHGFEDCBA"
"       HGFEDCBA"
"      GFEDCBA"
"     FEDCBA"
"    EDCBA"
"   DCBA"
"  CBA"
" BA"
,"A"
""

Explanation:

Create two lists, 1 with 25 spaces, 1 with the reversed alphabet, then drop the first item from each list and join together. Use converge \ to terminate when the output matches previous output (hence this results in a trailing empty line):

raze each (1_')\[(25#" ";reverse .Q.A)] / ungolfed solution
                 (      ;            )  / two item list
                  25#" "                / 25 take " ", whitespace 25 long
                         reverse .Q.A   / .Q.A is uppercase alphabet A..Z, reverse reverses, so Z..A
          (   )\[                     ] / converge running left function with right arguments
           1_'                          / 1 drop (_) each (') removes first item from each sublist and returns result (2 lists)
raze each                               / raze reduces a list of lists, so we reduce each sublist of 2 lists to a single list
\$\endgroup\$
1
\$\begingroup\$

Acc!!, 113 bytes

26
Count i while i-_ {
	Count b while b-25+i {
		Write 32
	}
	Count t while t-_+i {
		Write 90-t-i
	}
	Write 10
}

Try it online!

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

Implicit, 24 23 22 19 bytes

À¦\^(-(1ß-);%\1^ß1ö
À                    « push alphabet                       »;
 ¦                   « swap case                           »;
  \                  « reverse                             »;
   ^                 « push length                         »;
    (                « do                                  »;
     -               «  decrement string length            »;
      (1..)          «  while top of stack truthy          »;
        ß            «   print space                       »;
         -           «   decrement string length           »;
           ;         «  pop string length                  »;
            %        «  print string                       »;
             \1      «  knock first character off string   »;
               ^     «  push length                        »;
                ß1   «  print newline                      »;
                  ö  «  exit without implicit output if top of stack falsy  »;
                     « implicit infinite loop              »;

Try it online!

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

Kotlin, 87 71 bytes

Submission

{(0..25).map{(it..25).map{print(" ")
it}.map{print('Z'-it)}
println()}}

Beautified

        {
            // For it from 25 to 0
            (0..25).map {
                // Print that number of spaces
                // Print the alphabet backwards from that letter
                (it..25).map { print(" ")
                it}.map { print('Z' - it) }
                // Newline
                println()
            }
        }

Test

var f:()->Unit =
{(0..25).map{(it..25).map{print(" ")
it}.map{print('Z'-it)}
println()}}
fun main(args: Array<String>) {
    f()
}
\$\endgroup\$
1
\$\begingroup\$

uBASIC, 74 bytes

That pesky Chr$ function sure does like to add extra spaces

0ForI=0To25:?Tab(25-I);:ForJ=0To25-I:?Left$(Chr$(90-I-J),1);:NextJ:?:NextI

Try it online!

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

MY-BASIC, 100 bytes

Anonymous function that takes no input and outputs to the console

For I=0 To 25
For J=I To 25
Print" "
Next
For K=0 To 25-I
Print Left(Chr(90-I-K),1)
Next
Print;
Next

Try it online!

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

Yabasic, 79 bytes

Another BASIC answer for Ya.

For I=0To 25
For J=I To 25
?" ";
Next
For K=0To 25-I
?Chr$(90-I-K);
Next
?
Next

Try it online!

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

Recursiva, 50 24 23 22 bytes

{B26"P+*' '-L(}Z~}_(26

Try it online!

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

Canvas, 6 bytes

Z[↔]R⇵

Try it here!

Explanation (characters have been changed to their ASCII forms to look monospace):

Z       push the uppercase alphabet
 [ ]    map over prefixes
  ↔       reverse horizontally
    R   pad each line with the line number spaces
     ⇵  and reverse the whole thing vertically
\$\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.