# Semi-Diagonal Alphabet

Given a letter of the English alphabet, your task is to build a semi-diagonal alphabet to the input.

## How to build a Semi-Diagonal alphabet?

Brief Description: First, you take the position of the letter in the alphabet, P (P is 1-indexed here). Then, you print each letter until the input (inclusive) on a line, preceded by P-1 and repeat that letter P times, interleaving with spaces.

Examples:

• Given F, your program should output:

A
B B
C C C
D D D D
E E E E E
F F F F F F

• Given K, your program should output:

A
B B
C C C
D D D D
E E E E E
F F F F F F
G G G G G G G
H H H H H H H H
I I I I I I I I I
J J J J J J J J J J
K K K K K K K K K K K

• Given A, your program should output:

A


## Rules

• You may choose either lowercase or uppercase characters, but that should be consistent.

• You may have extraneous spaces as follows:

• One consistent leading space (on each line).
• A trailing or leading newline(s).
• Trailing spaces.
• Input and output can be taken by any standard mean, and default loopholes apply.

• You are allowed to output a list of lines instead, as long as you also provide the version.

• This is , so the shortest code in bytes wins!

Inspired by this challenge.

• Is output as list of strings ok? – Adám Aug 23 '17 at 15:16
• Why the downvote? What can i improve? – user70974 Aug 23 '17 at 15:45
• When you say "P is 1-indexed here", does here refer to the challenge or the example? – Dave Aug 23 '17 at 15:48
• @pizzakingme No, you may not. – user70974 Aug 23 '17 at 16:05
• I accidentlly got an interesting pattern while golfing my answer: tio.run/##K0nO@f@/… – sergiol Oct 19 '17 at 19:19

# SNOBOL4 (CSNOBOL4), 115 bytes

	U =&UCASE
U INPUT @L
N	U POS(X) LEN(1) . R
OUTPUT =DUPL(' ',X) DUPL(R ' ',X + 1)
X =LT(X,L - 1) X + 1	:S(N)
END


Try it online!

# Swift, 133 bytes

func f(c:String){for i in 9..<Int(c,radix:36)!{var s=""
for _ in 9..<i{s+=" "}

x->[" "^i*"$c "^i for (i,c) in enumerate('A':x)]  Try it online! # Excel VBA, 78 71 Bytes Anonymous VBE immediate window function that takes input from range [A1] and outputs to the VBE immediate window For i=1To[Code(A1)-64]:?:?Spc(i-1);:For j=1To i:?Chr(i+64)" ";:Next j,i  -1 Byte for switching to leading newline over trailing, and condensing Next statements -6 bytes for using Spc() over String() ## Burlesque - 39 bytes -]'Ajr@id?i?*m{' []}zim{p^' j?*j_+}unsh  This is not fully golfed yet and (trivially at least the sh can be replaced with Q) but it's a first start. m{}un can probably be replaced by a version of map that unlines and zim[ is a good candidate for a shortcut in the near future. The two maps can also probably be merged together into a single map. # Common Lisp, 89 bytes (dotimes(m(-(char-code(read))63))(format t"~va~v@{~c ~:*~}~%"m #\ m(code-char(+ m 64))))  Try it online! # SmileBASIC, 58 57 bytes INPUT E$WHILE L$<E$L=L+1L$=CHR$(L+#X)+" "?" "*L;L\$*L