28
\$\begingroup\$

Task

Your task is to print this exact text:

A
BCD
EFGHI
JKLMNOP
QRSTUVWXY
ZABCDEFGHIJ
KLMNOPQRSTUVW
XYZABCDEFGHIJKL
MNOPQRSTUVWXYZABC
DEFGHIJKLMNOPQRSTUV
WXYZABCDEFGHIJKLMNOPQ
RSTUVWXYZABCDEFGHIJKLMN
OPQRSTUVWXYZABCDEFGHIJKLM
NOPQRSTUVWXYZABCDEFGHIJKLMN
OPQRSTUVWXYZABCDEFGHIJKLMNOPQ
RSTUVWXYZABCDEFGHIJKLMNOPQRSTUV
WXYZABCDEFGHIJKLMNOPQRSTUVWXYZABC
DEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL
MNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW
XYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJ
KLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXY
ZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOP
QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI
JKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD
EFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZA
BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ

Specs

  • You may do it in all-lowercase instead of all-uppercase.
  • Trailing newlines at the end of the triangle is allowed.
  • Trailing spaces after each line is allowed.
  • You must print to STDOUT instead of outputting an array of strings.

Scoring

This is . Program with lowest byte-count wins.

emanresu A
46.2k5 gold badges111 silver badges257 bronze badges
asked Aug 21, 2016 at 11:07
\$\endgroup\$
5
  • 1
    \$\begingroup\$ What do you mean by "strikes again"? Was there another challenge you made like this? \$\endgroup\$ Commented Aug 21, 2016 at 13:46
  • \$\begingroup\$ @Peanut codegolf.stackexchange.com/questions/87496/alphabet-triangle \$\endgroup\$ Commented Aug 21, 2016 at 13:58
  • 1
    \$\begingroup\$ Seems fairly trivial do we really need (another) alphabet challenge? \$\endgroup\$ Commented Aug 21, 2016 at 21:44
  • 2
    \$\begingroup\$ It is a good challenge, but I think we have outstripped saturation of these alphabet challenges, nothing personal. \$\endgroup\$ Commented Aug 21, 2016 at 21:45
  • \$\begingroup\$ Actually looking for an alphabet challenge that the letter at a position cannot be calculated by simple expressions from its coordinates involving the mod function. May make one myself if I have time. \$\endgroup\$ Commented Jan 31, 2018 at 20:17

61 Answers 61

1 2
3
-1
\$\begingroup\$

C#, 164 bytes

void a(){int i=0;Console.Write(String.Join("\n",Enumerable.Range(0,26).Select(n=>new string(Enumerable.Range(0,n*2+1).Select(m=>(char)(97+(i++)%26)).ToArray()))));}
answered Aug 21, 2016 at 12:06
\$\endgroup\$
6
  • \$\begingroup\$ I believe "\n" is enough instead of "\r\n" \$\endgroup\$ Commented Aug 21, 2016 at 12:06
  • 1
    \$\begingroup\$ You need to count using System; and using System.Linq; \$\endgroup\$ Commented Aug 21, 2016 at 12:06
  • 2
    \$\begingroup\$ no i do not need to count them, theyre default packages. im getting sick of this remark \$\endgroup\$ Commented Aug 21, 2016 at 12:20
  • 3
    \$\begingroup\$ Actually, it seems like you do need to include using System, since otherwise I get an error about Console not existing in the current context. \$\endgroup\$ Commented Aug 21, 2016 at 19:49
  • 1
    \$\begingroup\$ meta.codegolf.stackexchange.com/questions/9847/… About java but the result is the same, either fully qualify them or include the namespaces \$\endgroup\$ Commented Aug 22, 2016 at 10:15
1 2
3

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.