| Bytes | Lang | Time | Link |
|---|---|---|---|
| 259 | Bespoke | 250818T041328Z | Josiah W |
| 037 | Google Sheets | 250502T103554Z | doubleun |
| 1025 | ☾ | 250314T172326Z | noodle p |
| 067 | なでしこ3 | 250303T124722Z | 鳴神裁四点一号 |
| 5344 | OpTeX | 250303T222939Z | jlab |
| 047 | Tcl | 170612T170914Z | sergiol |
| 086 | Swift | 231231T190807Z | macOSist |
| 014 | Vyxal | 231230T170151Z | Alan Bag |
| 051 | Python 3 | 231230T163819Z | Alan Bag |
| 017 | Uiua 0.3.1 | 231128T180644Z | RomanPro |
| nan | SNOBOL4 CSNOBOL4 | 180118T141133Z | Giuseppe |
| 005 | Vyxal 3 j | 231127T192337Z | pacman25 |
| 059 | Rust | 230122T213427Z | Victor N |
| nan | 230122T172443Z | The Thon | |
| 014 | Perl 5.28.1 webperl + l013 | 170608T084600Z | Dom Hast |
| 063 | JavaScript Node.js | 211210T184805Z | Alan Bag |
| 060 | Python 3.8 prerelease | 211209T145845Z | Alan Bag |
| 051 | Elixir | 210721T113722Z | Dom Hast |
| 005 | Vyxal rj | 210427T122109Z | Aaroneou |
| 121 | brainfuck | 210428T112038Z | Rachit A |
| 031 | Julia 1.0 | 210427T124857Z | MarcMush |
| nan | i386 Bootsector | 210426T133458Z | Dion |
| 827 | Deadfish~ | 210319T042415Z | emanresu |
| 009 | Husk | 201031T202731Z | LegionMa |
| 004 | 05AB1E | 200929T155210Z | Makonede |
| 055 | Rockstar | 200929T152520Z | Shaggy |
| 036 | Python 2 | 170608T031729Z | Dennis |
| 041 | Python 3 | 170611T100008Z | Harry W. |
| 021 | Attache | 181206T200900Z | Conor O& |
| 010 | Pushy | 181204T192219Z | FlipTack |
| 037 | C gcc | 181204T181447Z | ceilingc |
| nan | Aheui esotope | 181130T022703Z | cobaltp |
| 343 | Python 3 43 Bytes | 181129T201924Z | CodeGolf |
| 027 | PowerShell Core | 181129T195417Z | Edwin |
| 043 | MBASIC | 181129T183749Z | wooshiny |
| 048 | C++ gcc | 181129T034650Z | ceilingc |
| 007 | MathGolf | 181120T142732Z | maxb |
| 026 | PowerShell | 181121T155150Z | KGlasier |
| 065 | Dart | 181120T150827Z | Elcan |
| 037 | Red | 181120T113546Z | Galen Iv |
| 035 | ><> | 180712T201411Z | Sasha |
| 035 | Kotlin | 180710T010438Z | JohnWell |
| 074 | brainfuck | 180712T095424Z | Dorian |
| 052 | C# .NET Core | 180710T084754Z | Anth12 |
| 056 | Pascal FPC | 180710T225510Z | AlexRace |
| 028 | dc | 180710T220029Z | Sophia L |
| 049 | Yabasic | 180131T183533Z | Taylor R |
| 024 | Perl 6 | 180710T043306Z | Jo King |
| 033 | shortC | 180709T235820Z | Jonathan |
| 043 | Ruby | 180624T184647Z | Alex All |
| 030 | Ahead | 180622T033943Z | snail_ |
| 039 | Kotlin | 180622T040750Z | snail_ |
| 019 | Z80Golf | 180621T135915Z | lynn |
| 067 | PHP | 180418T191839Z | Francisc |
| 035 | QBasic 1.1 | 180616T202026Z | Erik the |
| 013 | CJam | 180615T201831Z | Esolangi |
| 056 | Python 2 | 180615T175726Z | Khalil |
| 056 | Pepe | 180226T201617Z | RedClove |
| 458 | Assembly nasm | 180423T220205Z | moonhear |
| 036 | Add++ | 180424T062701Z | ASCII-on |
| 104 | Underload | 180424T034053Z | Esolangi |
| 058 | Java OpenJDK 8 | 180423T133541Z | X1M4L |
| 045 | Gforth | 180417T195806Z | Kitana |
| 007 | Japt R | 180417T200153Z | Oliver |
| 036 | R | 170608T134807Z | Sven Hoh |
| 018 | K4 | 180412T222547Z | mkst |
| 035 | VBA | 170801T163840Z | Taylor R |
| 016 | J | 180115T192728Z | FrownyFr |
| 033 | SmileBASIC 3 | 180304T094617Z | snail_ |
| 6437 | Stax | 180228T163751Z | Weijun Z |
| nan | Python 3 | 180226T210702Z | Mercury |
| 002 | Canvas | 180227T035328Z | hakr14 |
| 051 | Python 3 | 180227T011257Z | The_Bass |
| 064 | brainfuck | 180226T231857Z | Jo King |
| 043 | Mouse2002 | 180226T215343Z | MooseOnT |
| 007 | APL Dyalog | 170608T060355Z | Adá |
| 035 | PowerShell | 180226T211316Z | root |
| 051 | Momema | 180210T044617Z | Esolangi |
| 022 | q/kdb+ | 170608T142112Z | mkst |
| 098 | Visual Basic .NET Mono | 180131T183230Z | Taylor R |
| 062 | MYBASIC | 180131T183021Z | Taylor R |
| 036 | uBASIC | 180131T182759Z | Taylor R |
| 012 | Pyth | 180119T024532Z | ericesch |
| 045 | Sincalr ZX81/Timex TS1000/1500 BASIC | 180115T153822Z | Shaun Be |
| 040 | AWK | 180115T153118Z | Robert B |
| 010 | Pushy | 171219T221550Z | FlipTack |
| 005 | RProgN 2 | 170918T010055Z | ATaco |
| 015 | Recursiva | 170826T030929Z | 0xffcour |
| 106 | BrainFlak | 170911T174512Z | DJMcMayh |
| 030 | Befunge98 PyFunge | 170911T172659Z | MercyBea |
| 013 | Pyth | 170907T230855Z | Stan Str |
| 080 | brainfuck | 170907T225106Z | Conor O& |
| 069 | TIBasic | 170608T154942Z | Timtech |
| 061 | Java 8 | 170608T080654Z | Kevin Cr |
| 073 | C++ gcc | 170813T193237Z | Karl Nap |
| 002 | SOGL V0.12 | 170813T094120Z | dzaima |
| 011 | Pyth | 170813T030329Z | chromati |
| 082 | C# | 170620T114451Z | Erlantz |
| 6014 | Seed | 170801T184504Z | TehPers |
| 054 | QBasic | 170801T153522Z | steenber |
| 018 | Ruby | 170731T134604Z | G B |
| 042 | Julia | 170731T133751Z | Goysa |
| 009 | Pyth | 170731T120557Z | Mr. Xcod |
| 052 | dc | 170725T142303Z | brhfl |
| 008 | Pyth | 170608T020134Z | user4854 |
| 070 | Common Lisp | 170717T162900Z | user6516 |
| 058 | Common Lisp | 170717T152011Z | Renzo |
| 038 | Groovy | 170717T144720Z | staticme |
| 075 | Swift 3 | 170630T123900Z | Endenite |
| 052 | Noether | 170608T102915Z | Beta Dec |
| 042 | Python 2 | 170608T013648Z | totallyh |
| 093 | Retina | 170620T105936Z | ovs |
| 042 | SimpleTemplate | 170610T192906Z | Ismael M |
| 010 | Ohm | 170608T230532Z | Datboi |
| 021 | k | 170617T204858Z | zgrep |
| 037 | Rexx Regina | 170610T195603Z | theblitz |
| nan | 170617T183342Z | algmyr | |
| 056 | R | 170614T003234Z | BLT |
| 114 | Batch | 170611T081519Z | stevefes |
| 043 | Modern Pascal 2.0 | 170612T135913Z | Ozz Nixo |
| nan | Bash | 170608T123841Z | marcosm |
| 6765 | Google Sheets | 170609T154119Z | Mr.Pariv |
| nan | 170608T195734Z | w3jimmy | |
| 023 | Perl | 170611T102256Z | Toto |
| 041 | Scala | 170608T101506Z | Aria Ax |
| 023 | PHP | 170609T144027Z | aross |
| 068 | C# | 170608T202155Z | Broom |
| 004 | Pyke | 170609T105208Z | Blue |
| 006 | Pyke | 170609T104831Z | Blue |
| 029 | Vim | 170608T094150Z | jmriego |
| 013 | Pure Bash | 170608T232606Z | Digital |
| 025 | Perl 6 | 170608T230021Z | Sean |
| 035 | Micro | 170608T204439Z | raddish0 |
| 002 | Charcoal | 170608T014356Z | Jonathan |
| 040 | AWK | 170608T181715Z | Robert B |
| 020 | braingasm | 170608T181050Z | daniero |
| 062 | Oracle SQL | 170608T175032Z | abrittaf |
| 043 | Haskell | 170608T161530Z | vroomfon |
| 039 | Mathematica | 170608T154426Z | Ian Mill |
| 097 | Go | 170608T153431Z | smt |
| 042 | ><> | 170608T112331Z | Teal pel |
| 047 | LOGO | 170608T145837Z | user2027 |
| 040 | R | 170608T101914Z | user2390 |
| 042 | Mathematica | 170608T074617Z | ZaMoC |
| 101 | S.I.L.O.S | 170608T144233Z | Leaky Nu |
| 047 | R | 170608T025548Z | Giuseppe |
| 038 | ><> | 170608T083554Z | Emigna |
| 1069 | Add++ | 170608T142357Z | caird co |
| 077 | Nano | 170608T133411Z | Wheat Wi |
| 009 | Japt | 170608T030749Z | Oliver |
| 063 | TSQL | 170608T135248Z | BradC |
| 069 | Google Sheets | 170608T115640Z | Engineer |
| 011 | V | 170608T020755Z | nmjcman1 |
| 028 | Aceto | 170608T112329Z | L3viatha |
| 103 | Brainfuck | 170608T095119Z | 6infinit |
| 1912 | Octave | 170608T073300Z | rahnema1 |
| 005 | MATL | 170608T093324Z | Luis Men |
| 029 | ZX Spectrum BASIC | 170608T092506Z | Neil |
| 052 | Tcl | 170608T090150Z | avl42 |
| 082 | C# | 170608T083103Z | TheLetha |
| 024 | Braingolf | 170608T081321Z | Mayube |
| 028 | J | 170608T072514Z | Jonah |
| 020 | Alice | 170608T060105Z | Nitrodon |
| 006 | 05AB1E | 170608T015434Z | Neil A. |
| 016 | Brachylog | 170608T070512Z | Fatalize |
| 028 | Ruby | 170608T055927Z | G B |
| 027 | QBIC | 170608T055341Z | steenber |
| 7572 | Javascript | 170608T022003Z | Steve Be |
| 017 | Brachylog | 170608T043220Z | Leaky Nu |
| 045 | C | 170608T020318Z | Doorknob |
| 039 | PHP | 170608T030529Z | user6395 |
| 029 | PowerShell | 170608T030453Z | Tessella |
| 009 | Jelly | 170608T015804Z | Jonathan |
| 031 | Cheddar | 170608T025933Z | Leaky Nu |
| 059 | JavaScript ES6 | 170608T021818Z | ETHprodu |
Bespoke, 259 bytes
make A-B-C letters located up-left go down towards right
set it off at corner of terminal;position it with spacing for an X at left
and at twenty-sixth position,stop making it
and at a borderline,output an ultimate newline
so easy,and it is simple creating it
When writing the "poetic" versions of these Bespoke programs, it's awfully convenient when it's an alphabet challenge, and I can represent the common idiom PUSH I H V for pushing zero as [word] A-B-C.
Google Sheets, 37 bytes
=index(char(32+munit(26)*row(65:90)))
Put the formula in cell A1. It creates a \$26 × 26\$ matrix of spaces and letters.

(there are two other Google Sheets answers from 2017: 65 bytes, 69 bytes)
なでしこ3, 67 bytes
aで0…25を繰返
連結(リフレイン(" ",a),CHR(a+97))言💧
which uses alert()-equivalent output function for each line.
Copy and paste the program above to なでしこ3 Web簡易エディタ and click ▶️実行
Or try here:
<script type=なでしこ>aで0…25を繰返
連結(リフレイン(" ",a),CHR(a+97))言💧</script>
<script src="https://nadesi.com/v3/cdn.php?v=3.7.2&f=release/wnako3.js&run"
></script>
OpTeX, 53 (or 44) bytes
After the alphabet staircase in OpTeX (a modernized version of plain TeX, a langage designed to typeset documents), the diagonal alphabet is straightforward
\fornum65..90\do{\fornum65..#1\do{~}\char#1\par}\bye
These needs 53 bytes.
But maybe we could do better with
\fornum65..90\do{\hskip#1ex\char#1\par}\bye
which corresponds to 44 bytes. Here \hskip#1ex add a space of <ascii code> ex, where 1 ex is the width of an x is the document's font. It's not exactly spaces before it equal to its position in the alphabet minus one, but visually it works.
As always, with TeX, the output is better with a mono-spaced font, available with \tt (typewriter font for TeX). This adds 3 more bytes.
Example:
\tt\fornum65..90\do{\hskip#1ex\char#1\par}\bye
Swift, 89 86 bytes
zip(0...,"abcdefghijklmnopqrstuvwxyz").map{print({String.init}()(" ",$0.0)+"\($0.1)")}
SNOBOL4 (CSNOBOL4), 72 65 bytes
E &LCASE O LEN(1) . O @X :F(END)
OUTPUT =LPAD(O,X) :(E)
END
swapping &UCASE for &LCASE would do the uppercase diagonal instead.
Rust, 59 bytes
for(i,l)in('a'..'{').enumerate(){println!("{l:>i$}",i=i+1)}
Thunno d, \$ 12 \log_{256}(96) \approx \$ 9.88 bytes
AzA{s' *s+ZK
Explanation
Az # Lowercase Alphabet
A{ # Enumerated for-loop:
s # Swap so the index is on top
' * # Multiply " " by the index
s+ # Swap and add the character
ZK # Print with a trailing newline
# d flag stops implicit print at the end
Thunno N, \$ 12 \log_{256}(96) \approx \$ 9.88 bytes
Az26R' *ZZ.J
Explanation
Az # Lowercase Alphabet
26R # range(26)
' * # Multiply " " by each number
ZZ # Zip together
.J # Join each inner list
# N flag joins by newlines
# Implicit output
JavaScript (Node.js), 63 bytes
for(i=0;++i<27;){console.log(" ".repeat(i)+(i+9).toString(36))}
Python 3.8 (pre-release), 60 bytes
n=0
for l in"abcdefghijklmnopqrstuvwxyz":print(" "*n+l);n+=1
Vyxal rj, 8 7 5 bytes
Thanks to lyxal for -1 bytes.
kaƛC꘍
There's a... couple leading spaces per line.
Explanation:
ka # Lowercase alphabet
ƛ # For each:
C # Convert to ordinal value
꘍ # Prepend that many spaces
# 'j' flag - join top of stack with newlines and print
brainfuck, 121 bytes
+++++++++++++[>+++++>++<<-]+++++[>>>++<<<-]++++[>>>>++++++++<<<<-]>>>>>-<<<[>>>+[>+>+<<-]>[<<.>>-]>[<<+>>-]<<<<<<.+>>.<-]
I'm new to golfing and I know this is extremely golfable but I just learned brainfuck and wanted to see if I could actually do something with it, so I'm sorry that this isn't an impressive answer.
i386 Bootsector, 19 bytes (Technically 512 due to padding)
Here is a hexdump of the program without padding:
0000-0010: b4 0e b3 61-88 d8 cd 10-b0 0a cd 10-fe c3 80 fb ...a.... ........
0000-0013: 7b 75 f1 {u.
And here is the original assembly:
mov ah, 0x0e
mov bl, 'a'
l:
mov al, bl
int 0x10
mov al, 0xa
int 0x10
inc bl
cmp bl, '{'
jne l
Very simple. Diagonal works by printing a newline without a carriage return.
Deadfish~, 827 bytes
{{i}}dddc{{d}i}iiic{ii}iic{iiiiii}iiiiiic{{d}i}iic{ii}iicc{{i}ddd}dddc{{d}i}ic{ii}iiccc{{i}ddd}ddc{{d}i}c{ii}iicccc{{i}ddd}dc{{d}i}dc{ii}iiccccc{{i}ddd}c{{d}i}ddc{ii}iicccccc{{i}ddd}ic{{d}i}dddc{ii}iiccccccc{{i}ddd}iic{{d}i}ddddc{ii}iicccccccc{{i}ddd}iiic{{d}i}dddddc{ii}iiccccccccc{{i}ddd}iiiic{{d}i}ddddddc{ii}ii{c}{{i}ddd}iiiiic{{d}}iiic{ii}ii{c}c{{i}ddd}iiiiiic{{d}}iic{ii}ii{c}cc{{i}dd}dddc{{d}}ic{ii}ii{c}ccc{{i}dd}ddc{{d}}c{ii}ii{c}cccc{{i}dd}dc{{d}}dc{ii}ii{c}ccccc{{i}dd}c{{d}}ddc{ii}ii{c}cccccc{{i}dd}ic{{d}}dddc{ii}ii{c}ccccccc{{i}dd}iic{{d}}ddddc{ii}ii{c}cccccccc{{i}dd}iiic{{d}}dddddc{ii}ii{c}ccccccccc{{i}dd}iiiic{{d}}ddddddc{ii}ii{cc}{{i}dd}iiiiic{{d}}{d}iiic{ii}ii{cc}c{{i}dd}iiiiiic{{d}}{d}iic{ii}ii{cc}cc{{i}d}dddc{{d}}{d}ic{ii}ii{cc}ccc{{i}d}ddc{{d}}{d}c{ii}ii{cc}cccc{{i}d}dc{{d}}{d}dc{ii}ii{cc}ccccc{{i}d}c
Husk, 9 bytes
z:¡Θø…"az
Try it online! ¡Θø is the infinite list [""," "," "," ",...], and …"az is the lowercase alphabet.
05AB1E, 8 4 bytes
₂A3Λ
-4 bytes thanks to @ovs.
₂ # push 26
A # push "abcdefghijklmnopqrstuvwxyz"
3 # push 3
Λ # draw a line on an ASCII canvas that is 26 characters long, uses lowercase letters in order for characters, and goes in direction 3 (southeast)
Rockstar, 55 bytes
X's0
while X-26
cast X+97 into C
say " "*X+C
build X up
Try it here (Code will need to be pasted in)
Python 2, 36 bytes
n=65;exec"print'%*c'%(n,n);n+=1;"*26
This takes advantage of the extraneous whitespace that does not affect appearance rule.
Alternate version, 38 bytes
n=1;exec"print'%*c'%(n,n+96);n+=1;"*26
This produces the exact output from the challenge spec.
Python 3, 41 bytes
for n in range(26):print(" "*n+chr(n+97))
Attache, 21 bytes
Output[sp*0:25+$a:$z]
Explanation
Output[sp*0:25+$a:$z]
Output[ ] write each entry as a line to stdout:
sp*0:25 spaces repeated 0 to 25 times (array)
+$a:$z each followed by a letter from "a" to "z"
Alternatives
22 bytes: Output[" "*0:25+$a:$z]
23 bytes: Print=>(" "*0:25+$a:$z)
24 bytes: Print@{_*sp+NTS@_}=>0:25
31 bytes: Print@&PadLeft=>Zip[$a:$z,1:26]
35 bytes: {Print@_If[$z!in_,$[sp+Succ@_]]}@$a
37 bytes: {Print@_If[_@-1/=$z,$[sp+Succ@_]]}@$a
37 bytes: Print@&PadLeft=>Zip[Chars@alpha,1:26]
40 bytes: Output!ZipWith[PadLeft,Chars@alpha,1:26]
40 bytes: Print=>ZipWith[PadLeft,Chars@alpha,1:26]
C (gcc), 37 bytes
f(i){for(i=2912;i++%113;printf(&i));}
Inspired by @NieDzejkob; needs to be run on a little endian ASCII machine from a terminal supporting vertical tabs. Try it online!
Aheui (esotope), 183 bytes (65 chars; 59 Hangul, 6 ASCII)
발밦다빠따반두발따받타빠싺싻삮타빠바파자초
분벋서썩떠번벌또여cbtp어또벓범석터번벋
타타빠싹빠싺밨볺아멓히셕처오져퍼서써섟뻐서
"cbtp" in the middle of the code is just an abbreviation of my nickname, which is ignored by the interpreter and reduce 8 bytes by using ASCII, not Hangul.
Python 3 43 Bytes
for i in range(26):print(" "*i+chr(i+97))
MathGolf, 10 7 bytes
▄{ï *▌p
I'm happy to announce that MathGolf now has a 1-byte literal for the lowercase alphabet! That should make any challenge related to the alphabet a lot easier!
Explanation
▄ Push alphabet as string
{ For-each
ï * Push " "*(loop counter)
▌ Prepend to the character
p Print
PowerShell, 29 26 bytes
'a'..'z'|%{' '*($_-97)+$_}
Output:
a
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
><>, 35 Bytes
0::?\~1+:8c*+oao:55*)?;!
-10.\84*o1
0 initialise counter
: make a copy to count spaces
:?\ only keep looping if greater than 0
\84*o output a space
- 1 decrement the inner counter
10. jump back to the start of the inner loop
~ delete the inner loop counter
1+ increment the outer counter
:8c*+o make a copy of the counter, add 96, output the character
ao output a newline
:55*)?; terminate if the counter is now 26 or higher
! skip the 0 at the start of the line
Kotlin, 36 35 bytes
Saved a byte by removing comma (lambda outside of call.)
{List(26){" ".repeat(it)+('a'+it)}}
brainfuck, 74 bytes
++++++++[->+++>+>++++++++>++++<<<<]>++>++<[->>>>[-<.>>+<]+>[-<+>]<<<+.<.<]
Explanation
++++++++[->+++>+>++++++++>++++<<<<]>++>++ Initialize tape:
26(letter count) 10(lf) 64("A" minus 1) 32(" ") 0(space count) 0(temp)
<[ for each letter count
- decrement letter count
>>>>[-<.>>+<] for each space count print space and move value to temp
+ increment space count
>[-<+>] add temp to space count
<<<+. increment and print letter
<. print lf
< go to count
]
C# (.NET Core), 71 58 53 52 bytes
for(var i='A';i<91;)WriteLine("".PadLeft(i-65)+i++);
Pascal (FPC), 56 bytes
Well, I found 2 programs with the same number of bytes.
Program 1:
var c:char;begin for c:='a'to'z'do writeln(c:ord(c))end.
Explanation:
var c:char; //declare c as char variable
begin
for c:='a' to 'z' do //iterate in a loop, c is getting values from a to z
writeln(c //write the current character followed by a newline
: //with a width of
ord(c)) //ASCII code of the current character
//(using extraneous whitespace allowed by the challenge)
end.
Program 2:
var i:byte;begin for i:=97to 122do writeln(chr(i):i)end.
Explanation:
var i:byte; //declare i as integer variable in range 0..255
begin
for i:=97 to 122 do //iterate in a loop, i starts from 97 and is incremented in each iteration
writeln(chr(i) //write character which ASCII codepoint is the current value of i
: //with a width of
i) //current value of i
//(using extraneous whitespace allowed by the challenge)
end.
dc, 28 bytes
97[ddPAP1+2z8*B-^+z27>M]dsMx
Outputs to stdout, makes lowercase letters
Explanation
P pops a number from the stack and outputs it as a base-256 byte stream. So I use some math to calculate each number (representing the appropriate string) "inductively" from the previous.
97 A literal, which P will print as ASCII 97 ('a')
[ Each loop starts with these two things true:
The next number to Print is on top of the stack
The stack depth is the # of times the loop has started (inclusive)
dd Make two copies: one to manipulate stack depth, one to print
PAP Print the number, then Print a newline (0x0A)
1+ Increment the last digit (i.e., the letter)
2z8*B-^+ Add the leftmost space, calculated as:
32*(256^loop counter) (because 32 = ' ')
= 2^5*(2^8)^(z-2) (z = stack depth = counter + 2)
= 2^(8z-11) (and to dc, 'B' pushes literal 11)
z27>M Repeat unless this was our 26th time through
]dsMx End the loop, store it as a macro, and run it
Yabasic, 49 bytes
Another basic answer which takes no input and outputs to the console.
For i=0To 25
For j=1To i?" ";Next
?Chr$(65+i)Next
Perl 6, 24 bytes
{map ' 'x$++~*,'a'..'z'}
Anonymous code block that returns a list of lines.
Alternatively,
{' 'x$++xx㉖Z~'a'..'z'}
behaves the same for the same bytecount.
Ahead, 31 30 bytes
"az"E>0\:'a-' l
@?lj:oNW:k\<
-1 because leading spaces are allowed as long as everything is still aligned.
Kotlin, 39 bytes
{('a'..'z').map{" ".repeat(it-'a')+it}}
Lambda returning a list of lines.
{ // lambda; implicitly return
('a'..'z').map { // map over the lowercase alphabet
" ".repeat(it - 'a') // repeat space by letter position
+ it // append letter
}
}
Z80Golf, 19 bytes
00000000: c661 ff3e 0aff 3e20 0c41 ff10 fd79 fe1a .a.>..> .A...y..
00000010: 20ee 76 .v
Disassembly:
restart:
add 'a'
rst $38
ld a, '\n'
rst $38
ld a, ' '
inc c
ld b, c
k:rst $38
djnz k
ld a, c
cp 26
jr nz, restart
halt
PHP, 72 68 67 Bytes
Try it online (after @Titus review)
Try it online, last review. @Titus Strikes Back
Code, recursive function
function f($v=26){$v&&print str_pad("",$v).chr($v+96)."
".f($v-1);}
Explanation
function f($v=26){
$v&&print # if $v not zero then print
str_pad("",$v) # pad spaces $v times
.chr($v+96) # concat the character at 96+$v
." # concat a linebreak
".f($v-1); # call the function
}
CJam, 13 bytes
26{_S*\'a+N}/
Explanation
26{ }/ for i in [0..25]:
S* puts ' ' * i
_ \'a+ puts 'a' + i
N puts '\n'
Python 2, 56 bytes
a=map(chr,range(65,91))
for i in a:print' '*a.index(i)+i
Pepe, 79 76 56 bytes
Way better, faster algorithm which performs like 3 times less operations. And saves 3 bytes. Now even more, because Pepe supports flags - no more unnecessary item movement!
REeEEEEeEErEeEEeeeeEREEreeereeErEEEEERrEeeEeeeeerEEEeRee
Explanation
REeEEEEeEE # push "{" to R
rEeEEeeeeE # push "a" to r
REE # label "{"
reee # print stack contents
reeE # print newline
rEEEEE # increment the letter
R rEeeEeeeee # prepend a space
rEEEe # r pointer to end
Ree # goto "{" if the letter didn't reach "{" yet
Assembly (nasm, x64, Linux), 62 59 55 45 + 8 bytes
func:
; R8 is the buffer the function will write the output to.
; most GPRs must be 0'd!
mov al, 'a'
inc edx
or r8, buf ; Suprise! It's more efficient to write it this way, the equivilent mov requires 3 bytes of padding to follow.
.append:
mov byte [r8+rbx], al
mov byte [r8+rbx+1], 0Ah
add ebx, 2
cmp al, 'z'
je .exit
inc eax
mov ecx, edx
inc edx
.dospaces:
mov byte [r8+rbx], ' '
inc ebx
; cx is used here. Be aware!
loop .dospaces
jmp .append
.exit:
ret
I spent a fair while doing this one. Seriously, some things will slowly drive you insane. This function outputs a buffer containing the requested data. Said buffer is in the .bss section.
NOTE: It doesn't seem to work on TIO for some reason. Works perfectly fine on my laptop. I built it using the following commands:
nasm -felf64 diagonal-alphabet_125117.s
gcc diagonal-alphabet_125117.o -no-pie
For your viewing pleasure, the TIO version is modified to use the data section instead, so it actually runs.
The bytecount is currently based on the bytecount of the function and the 8 bytes needed to represent the length of .bss
Note to future readers: A CC where most GPRs must be 0'd can be useful, because or is shorter than mov, at least in the case demonstrated above.
Add++, 43 36 bytes
D,f,@:^,32$yVVL97+
D,g,,26RBF€{f}
$g
Super suboptimal because I don't know what I'm doing
Underload, 104 bytes
(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)(
)(:S( )*~S):*::*:*::***^
The snippet :S( )*~S has the meaning:
- Duplicate and print the TOS
- Add a space to the TOS
- Print the string under the TOS
If the TOS starts as a newline and the strings on the stack form the alphabet (with a highest), then executing this snippet 26 times generates the correct output.
Java (OpenJDK 8), 58 bytes
a->{for(char b=96;b++<122;a+=' ')System.out.println(a+b);}
I had no idea that you could make a for loop with a char variable... but here ya go! I’m pretty proud of my solution here, it may be my most golfed submission to date!
Gforth, 45 Bytes
: X CR 26 0 DO i SPACES i 97 + EMIT CR LOOP ;
Explanation
Gforth doesn't allow interpretation of loops, so I had to define a new word X.
: X \ Define new word X
CR \ Go to a new line
26 0 DO \ Loop from 0 to 25
i SPACES \ Print i spaces
i 97 + EMIT \ Calculate ASCII-code and print it
CR \ Next line
; \ End of word definition
R, 38 37 36 bytes
write(intToUtf8(diag(65:90),T),1,26)
(The use of write is inspired by @Giuseppe's answer.)
K4, 18 bytes
Solution:
-1(-1-!26)$'$.Q.a;
Example:
q)k)-1(-1-!26)$'$.Q.a;
a
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
Explanation:
Left-pad the alphabet:
-1(-1-!26)$'$.Q.a; / the solution
-1 ; / print to STDOUT, swallow return
.Q.a / "abcdefghijklmnopqrstuvwxyz"
$ / string, basically 1#'
$' / pad ($) each-both
( ) / do together
!26 / range 0..25
-1- / subtract from -1
Bonus:
15 bytes returning a list of strings rather than printing to STDOUT:
(-1-!26)$'$.Q.a
VBA, 35 Bytes
Anonymous VBE immediate window function that takes no input and outputs the alphabet, diagonally, to the VBE immediate window
For i=0To 25:?Spc(i)Chr(97+i):Next
-2 Bytes thanks to @Chronocidal
Alternatively, 76 50 46 Bytes
Anonymous VBE immediate window function that takes no input and outputs the alphabet, diagonally, to the range [A1:Z26] on the VBE immediate window function
[A:Z]="=If(Row()=Column(),Char(64+ROW()),"""")
SmileBASIC 3, 33 bytes
FOR I=0TO 25?" "*I+CHR$(97+I)NEXT
Looks like 12Me hasn't answered this one yet…
Stax, 6 bytesCP437
åuvÉ◄┘
Explanation
Uses the unpacked format to explain.
Vam]i^)
Va "abcdefghijklmnopqrstuvwxyz"
m For each letter, execute the rest of the program
Output the result on individual lines
] Change the letter to a single-letter string
i^ Current loop index+1
) Pad the string to given length
Python 3, 74 64 63 Bytes
Saved ten bytes thanks to Caird
Saved one byte thanks to Stephen
Changed format to one-liner
Yes there are several Python 2 answers but how about one with Python 3?
for b in'abcdefghijklmnopqrstuvwxyz':print(' '*(ord(b)-97)+b)
First it makes a list of the alphabet then prints each letter but with n (Index of the value) spaces.
Python 3, 51 bytes
print("\n".join(" "*n+chr(n+97)for n in range(26)))
brainfuck, 64 bytes
+[[-<+>>++<]>]<<++[>[-<<<.>>>>+<]>+[-<+>]<<<+.<<---.+++>>>-----]
Prints in uppercase with a trailing newline.
Initialises the tape to 2N, and uses the 16(-3) as the newline, the 32 as the space, the 64 as the start of the uppercase alphabet, the 128(+2) as the counter (-5 each loop), and the cell at the end as the space counter.
Mouse-2002, 43 bytes
(A.Z1+<^A.B:(B.^" "B.1-B:)A.97+!'"!"A.1+A:)
Needs to be run in the Mouse-2002 Interpreter REPL. Working interpreter can be found here.
APL (Dyalog), 9 7 bytesSBCS
-2 bytes thanks to ngn's hint.
↑⍨∘-⌸⎕A
[Try it online!][TIO-j3o0ipjy]
⎕A the uppercase Alphabet
⌸ between each (element,list of indices) pair, insert the following tacit function:
↑⍨ from the element (the letter) take…
∘ the…
- negated-index number of characters, i.e. that many characters from the back, padding on the front with spaces.
PowerShell, 35 bytes
$i=97;0..25|%{" "*$_+[char]$i;$i++}
Pipes an array of 0 through 25 to ForEach-Object, which cycles through ascii codes and prefixes with a space multiplied by an incrementing variable.
Momema, 51 bytes
m01*0w1-9 32 1+*1-1w0w=*1-9+97*0-9 10 0+1*0m=+-26*0
Explanation:
# a = 0
m 0 # label m0: jump past label m0 (no-op) # do {
1 *0 # [1] = [0] # b = a
w 1 # label w0: jump past label w1 # while b != 0 {
-9 32 # print chr 32 # print ' '
1 +*1-1 # [1] = [1] - 1 # b -= 1
w 0 # label w1: jump past label w0 (no-op) # [end-of-loop jump point]
w =*1 # label w2: jump past label w((2 + !![1]) % 3) # }
-9 +97*0 # print chr 97 + [0] # print chr(97 + a)
-9 10 # print chr 10 # print '\n'
0 +1*0 # [0] = [0] + 1 # a += 1
m =+-26*0 # label m1: jump past label m((1 + !![0]) % 2) # } while a != 0
q/kdb+, 26 22 bytes
Solution:
-1(!:[26]#'" "),'.Q.a;
Example:
q)-1(!:[26]#'" "),'.Q.a;
a
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
Explanation:
Joins each letter of the alphabet with an increasing number of spaces. Brackets are used due to right-to-left evaluation.
-1(til[26]#'" "),'.Q.a; / ungolfed solution
-1 ; / print to stdout and swallow return value
.Q.a / shorthand for abc..xyz
,' / concatenate (,) each-left/each-right (')
( ) / do all this together
#'" " / take each-left/each-right (space)
til[26] / range of 0..25
Visual Basic .NET (Mono), 98 bytes
Declared Subroutine that that takes no input and outputs to the console.
Module M
Sub Main
Dim I
For I=0To 25
Console.WriteLine(Space(i)+Chr(65+I))
Next
End Sub
End Module
MY-BASIC, 62 bytes
Anonymous function that takes no input and outputs to the console.
For i=0 To 25
For j=1 To i
Print" "
Next
Print Chr(65+I);
Next
uBASIC, 36 bytes
Anonymous function that takes no input and outputs to the console.
0ForI=0To25:?Tab(I);Chr$(65+I):NextI
Pyth, 12 bytes
Fb26p*\ b@Gb
There's probably some way I can shave off a couple bytes, but I'm not quite sure yet.
Explanation:
Fb26p*\ b@Gb |
Fb26 | for b in range(26):
p | print(
*\ b | " "*b
@Gb | +G[b]
Note: G is initialized to "abcdefghijklmnopqrstuvwxyz"
Sincalr ZX81/Timex TS1000/1500 BASIC, ~45 tokenized BASIC bytes
1 FOR I=CODE "A" TO CODE "Z"
2 PRINT TAB (I-CODE "A");CHR$ I
3 NEXT I
Some notes; without adding in more bytes to the listing, the standard output to the screen is 32 x 22 only, so when the screen fills, you will need to press C, and the keyword CONT will appear. You will then see the rest of the alphabet.
For those who want to see the Alphabet without having to manually enter CONT each time the last row is hit in the text area, this solution does it for you:
1 FOR I=CODE "A" TO CODE "Z"
2 PRINT AT CODE "+",I-CODE "A";CHR$ I
3 SCROLL
4 NEXT I
This version costs another 9 tokenized bytes though.
AWK, 40 bytes
BEGIN{for(;i<26;)printf"%"++i"c\n",i+96}
I didn't see an AWK solution, so here we go. Straightforward implementation, so more golfing may be possible.
Pushy, 10 bytes
`a\x26`:"h32}
Where \x26 represents the literal byte 0x26.
`a\x26` \ Push 'a' and 26
: \ Pop 26, loop that many times:
" \ Print the stack
h \ Increment the letter
32} \ Prepend a space
RProgN 2, 5 bytes
aS`\x0B.
\x0B is a Vertical Tab Literal
This just takes the lowercase alphabet, splits it, and joins it with vertical tabs. This produces the intended effect on certain Bash Terminals.

Recursiva, 16 15 bytes
{)"P+*-O}97' '}
Explanation:
{)"P+*-O}97' '}
{ - For each
) - lower-case alphabet yield 'abc...z'
" - Iteration command begin
P - Print
+ - concatenate
*-O}97' ' - Appropriate number of spaces
} - current alphabet (iterate)
Brain-Flak, 124, 116, 106 bytes
((((()))))(((([][]){}){})[[]()]<>){(({})<(({})<({}<>({})({})<>)>)
{({}<(<>({})<>)>[()])}{}(<>[][]<>)>[()])}
Explanation:
This answer abuses the Stack Height Nilad, but in a new way that I've never used before, which I'm pretty proud of. Other than that, the answer's not too clever.
So analyzing the characters used in this ASCII art, there are really three values that are frequently used:
32 (space),
64 (add 64 to N to get the N'th letter of the alphabet), and
10 (newline)
As well as 26. (number of loops) And these numbers are pushed in different locations, so we can't really reuses intermediate values to make the large numbers smaller. And pushing all for of these numbers is a whopping 86 bytes alone:
10:
((()()()()()){})
26:
((((()()()){}){}()){})
32:
((((()()()()){}){}){})
64:
(((((()()()()){}){}){}){})
This is horrible. So here's how we make it more convenient. The obvious approach is to push a 32 onto the alternate stack, which makes our 32 snippet become: (<>({})<>) and our 64 snippet become (<>({})({})<>). If we combine our initial push 32 with our initial push 26, we can save 8 bytes roughly. (my first golf).
But here is where the trick I'm really proud of comes in. Since we're not using the alternate stack for anything else, we might as well golf down the 10 also. To do this, we'll push 4 arbitrary numbers onto the stack right at the start of the program. Since we also push 32, this increases the value of the [] nilad, to 5, which makes our 10 snippet much more convenient. And lucky for us, it actually lets us golf the push 32 and 26 snippet down too!
#Push 32, 26
(((((()()()()){}){}){})<>[(()()()){}])
#Push 10
((()()()()()){})
Becomes
#Push 32, 26 (-2 bytes)
(((((())))))((([][][]){}()())[[]]<>)
#Push 10 (-6 bytes)
(<>[][]<>)
So here is a detailed explanation:
# Push 1 four times
((((()))))
# Push 32 to main stack (to reuse later)...
((([][][]){}()())
# And then 26 to the alternate stack
[[]()]<>)
#While true
{
# Keep track of the current TOS
(({})<
# Push [TOS, TOS + 64] (To get uppercase characters)
(({})<({}<>({})({})<>)>)
# TOS times...
{
# Decrement the loop counter, while pushing a space underneath it
({}<(<>({})<>)>[()])
# Endwhile, pop zeroed counter
}{}
# Push 10 (newline)
(<>[][]<>)
# Push TOS - 1 back one
>[()])
# Endwhile
}
Befunge-98 (PyFunge), 30 bytes
1+:0\:'`+\' \k:>:#,_$:'␚-!k@a,
Where ␚ is a literal substitute character
Every line has 3 leading spaces
Pyth, 13 bytes
I've noticed that I've been getting better at these, but Dave or Mr. Xcoder will school me any day of the week.
Update: Pyth tester is down, rip back up.
#p*dt=hZhG=tG
Explanation:
# Loop until error
p*dt=hZ Print without newline: " " times ++Z - 1 (Z defaults to 0) (Could have used + instead of p, but it's easier to explain)
hG Implicit print with newline: The first character of the alphabet
=tG Remove the first letter in the alphabet variable
brainfuck, 80 bytes
++++++++[>+>++++>++++++++>+++<<<<-]>++>>+>++[->[<<<.>>>->+<]>+[-<+>]<<<.+<<.>>>]
Formatted:
++++++++[>+>++++
>++++++++>+++<<<
<-]>++>>+>++[->[
<<<.>>>->+<]>+[-
<+>]<<<.+<<.>>>]
Uses a simple multiplicative generation function to put some constants in memory, then repeats the process of printing N spaces then 'A' + N for N = 0..25.
Annotated:
INITIALIZE TAPE: 10 32 65 >26< 0 0
C_NEWLINE: 10
C_SPACE: 32
V_ALPHA: 65
V_COUNTER: 26
V_PREFIX: 0
V_PREFIX_TEMP: 0
++++++++[>+>++++>++++++++>+++<<<<-]>++>>+>++
WHILE V_COUNTER != 0 [-
"PRINT C_SPACE REPEATED V_PREFIX TIMES"
"V_PREFIX_TEMP = V_PREFIX"
V_PREFIX TIMES >[-
PRINT C_SPACE <<<.>>>
INCREMENT V_PREFIX_TEMP >+<
]
"V_PREFIX = V_PREFIX_TEMP PLUS 1"
V_PREFIX_TEMP PLUS 1 TIMES >+[-
INCREMENT V_PREFIX <+>
]
PRINT C_ALPHA <<<.
INCREMENT C_ALPHA +
PRINT C_NEWLINE <<.
>>>]
TI-Basic, 71 69 bytes
"
For(I,1,26
Disp sub(Ans+Ans+Ans+Ans,1,I)+sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",I,1
End
Java 8, 72 71 70 61 bytes
o->{for(int a=0;a++<26;)System.out.printf("%"+a+"c%n",a+96);}
-1 byte by outputting the uppercase alphabet instead of lowercase.
-1 byte by printing directly, instead of returning a multiline String.
-8 bytes thanks to @OliverGrégoire by using printf directly to get rid of String s="";. And also -1 byte by changing ()-> to o->.
C++ (gcc), 73 bytes
As unnamed generic lambda, requires a stream as parameter (like std::cout)
[](auto&O){for(char c=96;++c<123;O<<c<<'\n')for(char w=c-96;--w;O<<' ');}
SOGL V0.12, 2 bytes
z╝
z push the alphabet
╝ convert to a diagonal array
implicitly output as a newline joined string
Pyth, 11 bytes
j.b+*dNY26G
Explanation:
j.b+*dNY26G expects no input
j joins on new line
.b for...in loop, uses two iterator variables
+ joins *dN and Y
*dN repeats d (space) N times, where N is one of .b's iterating variables
Y another one of .b's iterating variables
26 the array being iterated for N,.b automatically takes the unary range
G initialized to the lowercase alphabet, the array being iterated for Y
C#, 82 bytes
var b="";for(int i=0;i<=25;i++){var a=(char)(97+i);b+=new string(' ',i)+a+"\r\n";}
Seed, 6014 bytes
I don't think this will win any awards, but just for fun, here's a solution in Seed.
86 11103250503694729158762257823050815521568836599011209889044745493166180250197633623839266491438081837290079379263402288506775397211362446108152606095635373134468715450376738199004596861532212810083090232034321755895588102701453625219810339758989366211308223221344886043229936009486687653111291562495367476364760255760906228050130847228170228716790260998430434027546345063918859356161024202180254514539438087787769611000320430464740566450402368450792375043801526494811596087812709169139468697779440918934518195843690439213251884693846598754642076364755341359062651237754916053099089619667382845958005035392458577634784453744876558142057256976895330859887974064083588368087014591508237946214519271550243549214199679364098489146944338807874570414584343165070707969101892779772740177526390597395955859236589308394889243501541206981604661264930842784772121710695027991351718061777696274815931123342985242351444203296855501870888626347939456384376808446806093364176576945969539054970975848477876079897476093353730443488664472826635815956526890935049081522728044807877072639829234224838977148057506785320443165975265560224605597481381188291535996775480326796788286452216432605854564432262547835415260058472165825285438444435690700488258778785613363062417500848996527077259315494936037544655054620369560227407957368700650031346856230643646273909094915618471799926504192999361174763592054723307855670381682927214117502862645460031555724588536036895597768493827964819026940533784490457441244859937078155137620826821294513857153097135094397278852300032685608169642137925241118197368192392427097109982751185030229544527638686131131545529690698706313745703838144933923021851042677941879847025167921010148923860660695145106913052517930707522151230705792709484338746351589089180137363986003757314611932324492978098101655359729841878862276799317010824753645947659706175083519817734448003718088115457982394423932136760435046136644679525408371158980833993157988971884061469882136904103033944270884697456159261033500286722891139158500027351042265757431184139617566089023339480051231776345929815102059539844917563709940188668873305602146506284075271989710388430531233185164106985265575418252638186398535149202928422854319253947591044830747981534342833040219194969504971457701296402664807369043224201667623773161453335066484102800249947322601702575025462427139266561015140950621152993027466758026351218924607290766894274223554418125824416921899080393405328694235821466034161071834073874727856768719898425047229002772806527172294625623026601313091815217479540688812203850300478145319935479599086534606210099372526810614742385909275512758349679098012967475393301857434507012875239092688018536028125644341148882858752275129016876257290205949225918496182271679312996010157634568807332616541938310641844258434083838017690572891417189135014450484203635258935943095637185443145042430274553211816422809756194554145177421779800554334935224073734034988935790096239926730047370699006392111034056662661567902477446646680125183082979598538506383502737734442490068661537425714549752783861222862366340979663873475326752237893690641570287341027097775099918958849864419430754493042534812120486345363285167685811903366691676146427476942948696624274431993989133835880516551024369474029197791751838810883302415448112237526350703063618171739262753474029252659418383385834751808940073804107171146665382663467460066719556797639176747423279761528061219482681051780434845070421974558638870988408449698678976622755518024906714421419806347234183574860655249471877105716127767795785164699804819127058322715857697491583787449703283625085118896433923054087238479453964363805045497229148813441732912067120594705269402106426011497763749556561398150139686331615167139081591537739333533146667211063179804707883556569241294269430626179579760506971066676011512530066694518309930078451295032445835025178124213221937594928472509588116557231122849491576207720183829735710200290762251904109318007206980645946249679357907549498615310165588678201768095297568708803842208357473777731751349499510116345704811971207818719582793964185192140178454948686109674659005978400204479072321714207828018696339659886683414074211823497880135255138161141724546221354224299071581607979907417508104234534779573666933024250229754952685174194168516481670999039048675109878524061868078078216337487277443941946961426121900907734301692962783139932352047932263834773963592317279425421954035566305805348109175553209815893678595198155962166838761859540063188209014774346841267440789072833797121217961797443744676162541668802226500817146368372390178287945076657776275930590173768326046610094573983886099504933977126798348879838826160714899283593774855907724617352862079916515034033299006419237012240730789008999523238851913897908225482003661109026061857228300111070725651744312468140016983078297938157227595743419983763920290850801438187869169473456288283458163865462359588316419331445070232596307970490434468929587726795603069137946085898481642595124580643542063564880389350236902538522311931690905858973696558714577085714396738993556273941292496636824719451697631982422926675238248502170501569627556395875619564600587531422890212003952929325067813498958390095519100963598626450443103780781917045489137526377521695121594716424797216910752252094749957224424042047863869830458287114846161217532552045343745235776511344577755412402833175338541217548987687334493461236111032661075185714361252784989689657180878190058132112701323898697673356854132286586129946906160482715702618768869398700713988301485421822519104930442450343377920756456344715552821899659777521739288202633751258303637433110490141551780764889912485271829265224821750882760152112536985349681370761157202793523201156381835717321637420939424473215237574260806475544972321933149796156065126465186203580256364372579422208318560608817806013462242728082475787319168695978160861791054731154820533251279706873332364894538291172324730671914083193733203570060223897442373172904974570329139578763294810924815364789498523721281918680145538278976651264
It translates to the following Befunge program:
vaa{ @>
v# g02<v
>30g20g` |
10g-:!v!: < >#<
v,:g02_40g,1- ^
>1+20p$91+, v
QBasic, 54 bytes
SCREEN 12
FOR x=1TO 26
LOCATE x,x
?CHR$(x+96)
NEXT
Explanation
SCREEN 12 Set the screen mode to something that can actially handle > 20 chars on a line
FOR x=1TO 26 Loop from 1 to 26
LOCATE x,x Set the cursior to the screen position x,x, starting at 1,1 on the top left.
?CHR$(x+96) Print the current letter of the alphabet
NEXT
Julia, 42 bytes
for i=0:25 println(" "^i,Char[97+i][1])end
Pretty straight forward, print space and character.
Pyth, 9 bytes
m+*;xGddG
The other Pyth approach is golfier because it uses enumerated map, which is 1 byte shorter. I just wanted to post a solution with regular map m, that happens to use the same variable, d as the built-in space. That may be inconvenient, because you cannot refer to the space with d. However, I did a work-around with ;, which gets the global value of the innermost lambda variable.
This returns a list of lines. In order to join them by newlines, we just need to add j in front of the whole code (the link contains the j for readability).
Explanation
jm+*;xGddG - Full program.
m G - Map over the alphabet with a variable d.
+ - Add:
* - The multiplication of:
xGd - The index of the current letter in the alphabet (0-indexed) and
; - Space (which is the global value of d, the innermost lambda
variable).
d - The current letter.
j - Optional: Join by newlines.
dc, 53 52 bytes
0si[32Plj1+dsjli>S]sS[0sjlid0<S1+dsi64+dPAP90>M]dsMx
Uppercase because checking that we're below character 90 (Z) is one fewer byte than checking that we're below character 122 (z). Otherwise pretty straightforward: one macro to print spaces and another to call the spacing macro, print the letter, and print a newline.
-1 byte because I forgot to golf my 10 into an A.
Pyth, 9 8 bytes
.e+*dkbG
Explanation
.e G For each element of 'abc...z'...
*dk Take a string of spaces with length equal to the index...
+ b Add the letter.
Common Lisp, SBCL, 70 bytes
(dotimes(i 26)(format t"~v@t~a
"i(aref"abcdefghijklmnopqrstuvwxyz"i)))
Looping through letters of alphabet and outputting accurate number of spaces before each letter.
another 70 bytes solution:
(format t"~{~26<~a~#@t~>
~}"(coerce"abcdefghijklmnopqrstuvwxyz"'list))
looping through letters and justifying to 26 columns, where word to justify is letter+accurate number of spaces.
building alphabet list using code-char would make it 76 bytes:
(format t"~{~26<~a~#@t~>
~}"(loop as i from 97 to 122 collect(code-char i)))
Groovy, 40 38 bytes
i=0;("a".."z").each{println" "*++i+it}
Previous solution:
0.upto(25){println" "*it+("a".."z")[it]}
iis used to store the number of spaces that must be printed before each letter. The program iterates through the range "a".."z" (the alphabet), printing each letter with i spaces before it and increments i inline.
Swift 3, 75 bytes
for i in 0..<26{print(String(repeating:" ",count:i)+String(i+10,radix:36))}
Noether, 52 bytes
"abcdefghijklmnopqrstuvwyxz"~aL(" "i*Pai/P"
"Pi1+~i)
Pushes the alphabet and loops through it, increasing the number of spaces before the character by one each time.
A non competing solution for 26 24 bytes is:
26(" "i*P0Ai/P"
"Pi1+~i)
Python 2, 42 bytes
Out-golfed... by Dennis, no less... ><
lambda:[' '*n+chr(n+65)for n in range(26)]
Retina, 93 bytes
aAbBc¶3d¶4e¶5f¶6g¶7h¶8i¶9jA0kA1lA2mA3nA4oA5pA6qA7rA8sA9tB0uB1vB2wB3xB4yB5z
B
¶2
A
¶1
\d+
$*
SimpleTemplate, 66 42 bytes
This simply loops through all characters and outputs them one by one, with newlines and spaces.
{@forfrom"a"to"z"}{@echolV,_}{@setV V," "}
This abuses the automatic variable _ and the automatic flattening of echoed arrays and automatic newline with echol.
Ungolfed: (produces invalid results due to whitespace)
{@for chr from "a" to "z"}
{@echo indentation, chr, "\n"}
{@// will create an array like: [[[..., " "], " "], " "]}
{@set indentation indentation, " "}
{@/}{@// automatically added after the code}
Old version:
There's a repeat function, but I couldn't use it because it's broken.
But this works too.
{@for_ from"a"to"z"}{@incz}{@callstr_repeat intos" ",z}{@echols,_}
Ungolfed: (produces incorrect results due to whitespace added)
{@set z 0}{@//removes warning}
{@for chr from "A" to "Z"}
{@inc spaces by 1}
{@call str_repeat into indentation " ", spaces}
{@echo indentation, chr, "\n"}
{@/}{@// automatically added after the code}
Ohm, 10 bytes
αß:^MüL;_,
Explanation
αß:^MüL;_,
αß # Pushes [a-z]
: # For each...
^MüL; # Print index amout of spaces
_, # Prints the char
k, 21 bytes
`0:`c$32+(65+!26)*=26
Explanation:
=26 /identity matrix of length 26
(65+!26)* /for i in {0..25}:
/ matrix[i] *= 65 + i
32+ /add 32 to everything
/ turns 0's into spaces
/ brings us to a lowercase alphabet for the rest
`c$ /turn to characters
`0: /write to stdout/stderr
vim 14+16=30 keystrokes
16 keystrokes if you have alpha in nrformats already (I mean, who hasn't?), 30 otherwise.
:set nf=alpha<cr>
ia<esc>
qqYp<c-a>I <esc>q
24@q
Angle brackets denote single characters, e.g. <c-a> is ctrl+a (increment). Actual newlines only for clarity. Seriously, set nf+=alpha is really neat, and it's a feature I've missed in a few specific cases when programming.
R, 56 bytes
for(i in 1:26){cat(rep(" ",i-1),LETTERS[i],'\n',sep='')}
Prints i-1 spaces and the ith letter of the alphabet, plus a newline, 26 times.
Outgolfed by Giuseppe (47 bytes),
user2390246 (40 bytes),
and Sven Hohenstein (37 bytes), but this is the only answer (so far) that doesn't use diag.
Batch, 187 114 bytes
@set s=
@for %%p in (a 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)do @call:e %%p
:e
@echo(%s%%1
@set s= %s%
Modern Pascal 2.0, 43 bytes
for var l:=97 to 122 do write(chr(l),#13);
Explanation For loop range is the ascii of 'a' to 'z', and the output is converting the ordinal to character, followed by LF (Line Feed, not CRLF), thus producing a forward diagonal alphabet. Also, Modern Pascal does not require the Begin/End block on simple instructions like this.
// Author of Modern Pascal
Bash, 38 36 35 bytes
printf "%*s
" `echo $[++i]\ {a..z}`
2 bytes less thanks to @DigitalTrauma
1 byte less thanks to @NahuelFouilleul
"%*s\n" takes padding as an argument.
$((++i))\ {a..z} for each letter increment and prepend i plus space (arithmetic expansion)
Google Sheets, 67 65 bytes
=ArrayFormula(IF(ROW(A1:Z)=COLUMN(A1:Z26),CHAR(96+ROW(A1:Z26)),))
=ArrayFormula(IF(ROW(A1:Z)=COLUMN(A1:Z26),CHAR(96+ROW(A1:Z26)),""))
Going off the clarification that any whitespace will do, I've used visibly empty cells
Let me know if this doesn't count, if I've misunderstood the byte count or if I've screwed up some etiquette as this is my first post here.
Edit: It turns out I can save 2 bytes by leaving out the "" as Google sheets will accept an empty if value.
JAVASCRIPT
Option 1: 59 bytes
a='';for(i=0;i<26;)a+=''.padEnd(i++)+(i+9).toString(36)+`
`
Option 2: 60 bytes
a='';for(i=0;i<26;)a+=' '.repeat(i++)+(i+9).toString(36)+`
`
Option 3: 61 bytes
a='',i=0;while(i<26)a+=' '.repeat(i++)+(i+9).toString(36)+`
`
Option 4: 67 bytes
a='';for(i=0;i<26;)a+=' '.repeat(i++)+String.fromCharCode(96+i)+`
`
Option 5: 68 bytes
[...Array(26)].map(_=>' '.repeat(++i-10)+i.toString(36),i=9).join`
`
Perl: 23 bytes
22 + 1 for -E flag.
say$"x$i++,$_ for a..z
Usage:
perl -E 'say$"x$i++,$_ for a..z'
Scala, 41 bytes
('a'to'z').map(a=>println(" "*(a-'a')+a))
Previous answer: 45 bytes
(0 to 25).map(a=>printf("%s%c\n"," "*a,97+a))
It is 1 byte shorter than
(0 to 25).map(a=>println(" "*a+(97+a).toChar))
PHP, 23 bytes
Note: uses IBM-850 encoding.
<?=join(~¶,range(a,z));
Run like this:
echo '<?=join(~¶,range(a,z));' | php -n;echo
# With default (utf8) terminal:
echo '<?=join("\v",range(a,z));' | php -n;echo
Explanation
Create an array of all characters of the alphabet, join it with a vertical tab as glue.
C# 73 68 bytes (Thanks to raznagul)
I'm pretty new to this. Do I need to include class/main declaration overhead for C#?
Edited to include anonymous function declaration
()=>{for(var x='a';x<123;)Console.WriteLine("".PadLeft(x-97)+x++);};
Pyke, 4 bytes
G\J
G - alphabet
\J - "\x0B".join(^)
Joins alphabet by vertical tabs
Vim, 29 bytes
:h<_↵↵↵y$ZZ25o <Esc>{qqpblD+q25@q
↵ means press the return key
< Esc> means press the escape key
How does this work?
:h<_↵↵↵ Open the help and navigate to the alphabet
y$ZZ Copy the alphabet and close the help
25o <Esc> Abuse auto-indent and create a whitespace diagonal
gg Go to the beginning of the file
qq Record a macro
pb Paste the alphabet and go to the first letter
lD Go to the second letter and cut the rest of the alphabet
+ Go to the first non-blank character in the next line
q Stop recording the macro
25@q Run the macro for the remaining letters
Pure Bash, 13
echo {a..z}^K^H
Here ^K and ^H are literal vertical tab and backspace ASCII control characters. The xxd dump of this script is as follows - use xxd -r to regenerate the actual script:
00000000: 6563 686f 207b 612e 2e7a 7d0b 08 echo {a..z}..
{a..z}is a standard bash brace expansion to producea b c ... z(space separated)- the
^Kvertical tab drops the cursor down one line to the same position - the
^Hbackspace moves the cursor back one to erase the separator space
Try it online. col and tac are used in the footer to get this to render correctly in a browser window, but this is unnecessary in a regular terminal.
If the above unorthodox control characters in the output are too much of a stretch for you, then you can do this:
Bash + common utilities, 24
echo {a..z}^K^H|col -x|tac
Here ^K and ^H are literal vertical tab and backspace ASCII control characters. The xxd dump of this script is as follows - use xxd -r to regenerate the actual script:
00000000: 6563 686f 207b 612e 2e7a 7d0b 087c 636f echo {a..z}..|co
00000010: 6c20 2d78 7c74 6163 l -x|tac
Try it online. The vertical tab and backspace may be rendered invisible by your browser, but they are there (invisible on chrome, visible on firefox).
col -xre-renders the input such that funny control characters are replaced with spaces and newlines to give the same visual result- for some reason
coloutputs lines in reverse order.taccorrects that.
Perl 6, 25 bytes
{" " «x«^26 Z~'a'..'z'}
This function returns a list of the required strings: "a", " b", " c", ...
^26 is a list of the numbers from 0 to 25. «x« is the string-replication hyperoperator that maps each element n of its right-hand side to the left-hand side replicated n times, producing the list "", " ", " ", .... That list is then zipped with string concatenation (the Z~ operator) with the range of letters from 'a' to 'z'.
Micro, 35 bytes
64:i {i1+:i i c:\
64 26+i=if(,a)}:a a
Charcoal, 2 bytes
↘β
How?
β - the lowercase alphabet
↘ - direction
Exactly the kind of challenge for which Charcoal was originally designed.
AWK, 40 bytes
BEGIN{for(;++i<27;)printf"%"i"c\n",i+96}
I'm curious if there's a shorter way to do this in AWK.
braingasm, 20 bytes
26[#[32.]97+#+.10.>]
26 times, print (.) a space (32) # (current position on the tape) times; increase cell (+) by 97, then by #; and print the current cell value, along with a newline (10); then go to next cell (>).
Oracle SQL, 62 bytes
SELECT LPAD(CHR(LEVEL+96),LEVEL) FROM DUAL CONNECT BY LEVEL<27
Haskell, 66 65 58 57 45 43 bytes
Thanks to @nimi and @maple_shaft for saving 12 14 bytes.
unlines[(' '<$['b'..n])++[n]|n<-['a'..'z']]
Mathematica, 39 Bytes
Grid@DiagonalMatrix@Alphabet[]/. 0->" "
This has trailing whitespace.
Explanation:
Alphabet[] - Create a list of the alphabet
DiagonalMatrix@ - Use that as the diagonal of a matrix
/. 0->" " - Replaces the 0's with whitespace
Grid@ - Then turn it into a 2D grid
Go, 97 bytes
package main;import."strings";func main(){for i:=0;i<26;i++{println(Repeat(" ",i)+string(i+97))}}
Definitely not the best language to golf with but wanted to get my first solution up, also should note this prints to stderr but I assume that's okay if it's not specificed
Go (as far as I know) lacks the ability to specify a dynamic width for padding formatted strings which is why I had to bring in and use strings.Repeat()
Readable version:
package main
import . "strings"
func main() {
for i := 0; i < 26; i++ {
println(Repeat(" ", i) + string(i+97))
}
}
><>, 46 44 42 bytes
"A"0::?!v" "o1-40.
*(?!;30.>~$:oao1+$1+:d2
Explanation
Line 1:
"a"0::?!v" "o1-40.
"a"0 :Initialize the stack items (print char and space count)
::?!v :Duplicate the space count, check if 0, go down if 0
" "o1- :Print a space then take 1 from the space count
40. :Jump to codepoint row 0 col 4 (this restarts the loop)
Line 2:
*(?!;30.>~$:oao1+$1+:d2
>~ :Remove the zeroed space counter off the stack
$:oao1+ :Place our print char on the top of the stack, duplicate and print it, print a new line, increase it by 1; a->b->c etc
$1+ :Place our space count on the top of the stack and increase it by 1
* :d2 :Duplicate the space counter, add 26 to the stack
(?!; :Add 0 to the stack, less than compare 0, if the counter is above 0 it terminates
30. :Jump to the first line, (back to printing spaces)
This is a completely different take from my previous 46 bytes so I've included the TIO to the only one as well. 46 bytes Try it online!
Below is a link to Emigna's submissions, it was the first ><> answer but I believe mine is different enough (and saves a few bytes) to warrant a second one.
LOGO, 47 bytes
Can be tried with FMSLogo. Unfortunately the version at Turtle Academy does not work well.
for[i 0 25][repeat :i[type "\ ]show char 65+:i]
R, 40 bytes
write(c("",LETTERS)[diag(1:26)+1],"",26)
diag(1:26)+1 # Create a matrix of ones with 2:27 on the diagonal
c("",LETTERS) # Create a vector containing an empty string followed by the alphabet
c("",LETTERS)[diag(1:26)+1] # Use that vector as a lookup table for the matrix
write( ,"",26) # Print over 26 columns
Use of write() copied from @Giuseppe's answer, but uses a different approach to creating the matrix.
Outgolfed by Sven Hohenstein
Mathematica, 42 bytes
Table[" "~Table~i<>Alphabet[][[i]],{i,26}]
outputs a list of strings
S.I.L.O.S, 101 bytes
a=26
c=97
lblb
i=0
GOTO d
lblc
print
b-1
i+1
lbld
if b c
b=i+1
printChar c
printLine
a-1
c+1
if a b
R, 59 49 47 bytes
-10 bytes thanks to djhurio
-2 bytes thanks to Sven Hohenstein
write("diag<-"(matrix("",26,26),letters),"",26)
Prints to stdout. Outgolfed by user2390246
><>, 50 49 46 45 38 bytes
0>:5d*+oao:64*)?;1+:191.
?v84*o:{1+:}(
Explanation
0> # initialize outer counter and start outer loop
:5d*+oao # add outer counter to 65 and print as ascii followed by a newline
64*)?; # if outer counter is greater than 24, end program
1+:1 # increment outer counter and initialize inner counter
91. # jump to inner loop
:}(?v # if inner counter is greater than outer counter go back to outer loop
84*o # else print a space character
:{1+ # and increment inner counter
Add++, 1069 bytes
+97
&
-87
&
+22
&
+66
&
-88
&
+22
&
&
+67
&
-89
&
+22
&
&
&
+68
&
-90
&
+22
&
&
&
&
+69
&
-91
&
+22
&
&
&
&
&
+70
&
-92
&
+22
&
&
&
&
&
&
+71
&
-93
&
+22
&
&
&
&
&
&
&
+72
&
-94
&
+22
&
&
&
&
&
&
&
&
+73
&
-95
&
+22
&
&
&
&
&
&
&
&
&
+74
&
-96
&
+22
&
&
&
&
&
&
&
&
&
&
+75
&
-97
&
+22
&
&
&
&
&
&
&
&
&
&
&
+76
&
-98
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
+77
&
-99
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
&
+78
&
-100
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
&
&
+79
&
-101
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
+80
&
-102
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
+81
&
-103
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
+82
&
-104
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
+83
&
-105
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
+84
&
-106
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
+85
&
-107
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
+86
&
-108
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
+87
&
-109
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
+88
&
-110
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
+89
&
-111
&
+22
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
&
+90
&
P
Yep. That is hardcoded. I'm sure there is a better way, and if you want to find it, go ahead, but this way seems to work the best as Add++ is difficult to work with memory.
Nano, 186 77 bytes
M- represents the alt key
M-ia
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
Explanation
I've seen a few Vim answers on this site so I thought I would do a nano answer. Its not nearly as terse as the Vim answers but its still better than typing out the whole thing.
This is pretty simple (a lot simpler than my original answer). M-i sets the auto-indent on. This means that every line will copy the indentation of the last. So we start with a and every line add a space and a letter all the way through.
Japt, 10 9 bytes
Saved 1 byte thanks to @Shaggy
;C£RiXiYî
Explanation:
;C£RiXiYî
;C // Lowercase alphabet
£ // Map; At each char:
R // Newline
iX // Insert: X (Iterative char)
iYî // Insert: " " repeated Y (index) times
By default, i inserts the target char at index 0. So, RiXiYî becomes Yî +X+R.
T-SQL, 63 bytes
DECLARE @ INT=0a:PRINT SPACE(@)+CHAR(@+65)SET @+=1IF @<26GOTO a
Written more conventionally, that would be:
DECLARE @ INT=0
a:
PRINT SPACE(@) + CHAR(@+65)
SET @ += 1
IF @<26 GOTO a
Tested and working on SQL Server 2012.
Google Sheets, 69 bytes
=ArrayFormula(JOIN("
",REPT(" ",ROW(A1:A26)-1)&CHAR(96+ROW(A1:A26))))
Nothing complicated here. The only trick is using ArrayFormula and ROW(A1:A26) to return 26 different values for the JOIN function. Output looks like this:
I think Excel 2016 can do the same thing with TEXTJOIN but I can't enter array formulas in the online version and only have 2013 myself. The formula should be this:
=TEXTJOIN("
",FALSE,REPT(" ",ROW(A1:A26)-1)&CHAR(96+ROW(A1:A26)))
Entering it as an array formula (Ctrl+Shift+Enter) adds curly brackets { } on both sides, bringing it to 67 bytes. Anyone who can verify it works is welcome to use it as their own answer.
V, 15 13 11 bytes
¬azòÙr klDj
Explanation
¬az ' Insert a-z
ò ' Recursively
Ù ' Duplicate current line down
r ' Replace the first character with a ' '
kl ' Move up a line and right
D ' Delete from here to the end
j ' Move back down
Aceto, 28 bytes
L 'XcIo
p*=`MILp
aM{'&n
'@dL
Explanation:
First of all, we put the character a in our quick storage ('aM) and set a catch point (@). We then duplicate the top stack element (initially a zero) and load both from quick storage and from the character literal {. These characters are then tested for equality, in which case we exit (=`X).
Otherwise we push a space and multiply it with the previously duplicated stack element (used as a counter). This is then printed, which prints nothing the first time this is run, a single space the second time, and so on (' *p).
We load the current character again and print it, then we load it again, convert it to the number of its codepoint, increment it, convert it to a character again and memorize it (LpLoIcM). Finally, we increment our counter, print a newline, and jump to the catch mark (In&).
Brainfuck, 103 bytes
>-<-----[[<+>->>+++>-<<<]>++]<<<<<<<<<[-]>>>-[<[-]<[-]<[>+>+<<-]>>[<<+>>-]<[>>>>.<<<<-]<+>>>>.+>>.<<<-]
The location of the variables is somehow improvable.
Explanation
>-<-----[[<+>->>+++>-<<<]>++] Initializes the tape.
<<<<<<<<<[-]>[-]>>- Resets variables that
need to be at 0.
[ For loop (25 to 0).
<[-]<<[>+>+<<-]>>[<<+>>-] Copy the spaces count in
order to use it in a loop.
<[>>>>.<<<<-] Prints the spaces.
Prints the character followed
<+>>>>.+>>.<<<- by a new line. Also decrements
the main loop counter.
]
Octave, 25 19 or 12? bytes
[diag(65:90)+32 '']
Other solution proposed by @LuisMendo (12 bytes) that I tested it in windows version of Octave:
diag('a':'z')
Explanation:
Generates diagonal matrix of a:z.
MATL, 5 bytes
2Y2Xd
Explanation
2Y2 % Predefined literal: 'a':'z'
Xd % Diagonal matrix. Implicit display
ZX Spectrum BASIC, 29 bytes
FOR i=NOT PI TO VAL "25": LPRINT TAB i;CHR$ (i+VAL "97"): NEXT i
Numeric literals carry a 6-byte penalty, so using VAL saves me 3 bytes (VAL is a 1-byte token). Note: The ZX Spectrum's output area is only 22 lines high, so I'm sending the output to the printer instead.
Tcl, 52 bytes
set i 96;time {puts [format %[incr j]c [incr i]]} 26
time is really a tool for measuring time spent, but it's also handy for repetition of code. Indentation and letter are advanced in each iteration. Ascii code i needs preset to one-before-first-letter, j will be auto-set to 1 on first incr.
If run in an interactive tclsh, the time would also output timings, but if the line is in a script, then it's silent, except for the diagonal.
C#, 82 bytes
using System.Linq;()=>Enumerable.Range(0,26).Select(i=>"".PadLeft(i)+(char)(i+65))
Works by creating an array of ints from 0 - 25, creates a string of i length of only spaces. Then adds a char onto the end corresponding to an upper case letter. It lastly implicitly returns an array, in this case an IEnumerable<string>, of each line.
Braingolf, 24 bytes
V# 7-#
R#a[R!&@# >1+v!@]
Explanation
V# 7-#\nR#a[R!&@# >1+v!@]
V Create stack2 and switch to it
# 7- Push 32 and subtract 7
#\n Push newline
R Return to stack1
#a Push lowercase a
[............] Do-while loop, uses stack2 for loop counting
Will run 26 times
R Return to stack1
!&@ Print entire stack without popping
# > Push space and move it to start of stack
1+ Increment letter
v Switch to stack2
!@ Print newline
J, 28 bytes
([,{&a.@+&97@#)@#&' '"0 i.26
pretty:
([ , {&a. @ +&97 @ #) @ #&' ' "0 i.26
Alice, 22 20 bytes
52E&waq'a+q&' d&o]k@
Even though the output is a string, it turns out ordinal mode is not the way to go for this challenge.
Explanation
52E&w k@ do 26 times
a push 10 (LF)
q push current tape position (initially zero)
'a+ add the ASCII code for "a"
q&' push 32 (space) a number of times equal to tape position
d&o output entire stack
] move tape position one space to the right
Previous solution
["za/?rO&
' !]\"ohkw@/
I went through about ten 23-byte solutions before I was able to find this one.
Explanation
This program uses the tape to track the number of spaces to output. Cardinal and ordinal modes use the same tape, but they have separate tape heads. The two modes have different interpretations of what they see on the tape, and the program fully exploits that difference.
The commands are executed in the following order:
[ move cardinal tape position left
"za" push this string (as a string, since the final " is in ordinal mode)
r interpolate to entire range (i.e., the lowercase alphabet backward)
h split first character from string
& for each character in string: push that character and...
w push current address onto return address stack
' ! (cardinal mode) place 32 (space) at current cardinal tape position
] (cardinal mode) move cardinal tape position right
? (back to ordinal mode) read string from tape starting at ordinal tape position
this string will consist of n-1 spaces.
o output string of spaces
O output top of stack (current letter) followed by newline
k return to pushed return address.
after 26 times through this loop, the return address stack will be empty and this is a no-op.
@ terminate
05AB1E, 14 8 6 bytes
-2 bytes thanks to @Emigna
AvyNú»
How it works
A # lowercase alphabet
v # for letter in alphabet
y # push letter
N # push index of letter
ú # Pad letter with index of letter spaces
» # Join with stack on newline.
Original version, 14 bytes
26FNð×N65+ç«}»
Brachylog, 16 bytes
Ạ;I∋₎C∧Ṣ;Ij₎wCẉ⊥
Explanation
Ạ;I∋₎C C is the Ith character of "abcdefghijklmnopqrstuvwxyz"
∧Ṣ;Ij₎ Juxtapose " " I times
w Write to STDOUT
Cẉ Writeln C to STDOUT
⊥ False: try another C
Ruby, 28 bytes
26.times{|a|puts" "*a<<97+a}
Explanation:
The << operator on a string in Ruby does the trick, as explained in the Documentation
str << integer → str
str << obj → str
Append—Concatenates the given object to str. If the object is a Integer, it is considered as a codepoint, and is converted to a character before concatenation.
QBIC, 27 bytes
[26|?space$(a-1)+chr$(a+96)
Explanation
[26| FOR a = 1 to 26
?space$(a-1) PRINT a-1 spaces (SPACES$ is a QBasic function that prints x spaces)
+chr$(a+96) and a char representation of a+96
Javascript, 75 72 bytes
_=>[...'abcdefghijklmnopqrstuvwxyz'].map((n,i)=>' '.repeat(i)+n).join`
`
3 bytes thanks to Stephen S.
PHP, 39 bytes
for($s=a;!$s[26];$s=" ".++$s)echo"$s
";
PowerShell, 29 bytes
0..25|%{' '*$_+[char]($_+97)}
Jelly, 10 9 bytes
-1 byte thanks to Dennis (avoid decrementing J by using a lowered range, 26Ḷ, directly)
26Ḷ⁶ẋżØaY
A full program that prints the result.
(ØaJ’⁶ẋż for 7 is a monadic link that returns a list of lists of lists of characters, but that is like [["a"],[" ","b"],[" ","c"],...] which is probably unacceptable.)
I would, however, not be surprised if there was a shorter way I have not thought about!
How?
26Ḷ⁶ẋżØaY - Main link: no arguments
26 - literal 26
Ḷ - lowered range = [0,1,2,...,26]
⁶ - literal space character
ẋ - repeat [ [], [' '], [' ',' '], ..., [' ',' ',...,' ']]
Øa - yield lowercase alphabet
ż - zip [[[],'a'],[[' '],'b'],[[' ',' '],'c'],...,[[' ',' ',...,' '],'z']]
Y - join with newlines [[],'a','\n',[' '],'b',\n',[' ',' '],'c','\n',...,'\n',[' ',' ',...,' '],'z']
- implicit print (smashes the above together, printing the desired output)
Cheddar, 31 bytes
->(|>26).map(n->' '*n+@"(n+97))
Defines a niladic lambda which returns a list of strings.
Full program, 42 bytes
print(|>26).map(n->' '*n+@"(n+97)).asLines
JavaScript (ES6), 60 59 bytes
f=(n=10)=>n-36?" ".repeat(n-10)+n.toString(++n)+`
`+f(n):""
A recursive function which returns a string with a trailing newline.




