Alphabet Staircase

30

2

The Challenge

Your task is to create a program or function that outputs the following with no input:

a
bb
ccc
dddd
eeeee
ffffff
ggggggg
hhhhhhhh
iiiiiiiii
jjjjjjjjjj
kkkkkkkkkkk
llllllllllll
mmmmmmmmmmmmm
nnnnnnnnnnnnnn
ooooooooooooooo
pppppppppppppppp
qqqqqqqqqqqqqqqqq
rrrrrrrrrrrrrrrrrr
sssssssssssssssssss
tttttttttttttttttttt
uuuuuuuuuuuuuuuuuuuuu
vvvvvvvvvvvvvvvvvvvvvv
wwwwwwwwwwwwwwwwwwwwwww
xxxxxxxxxxxxxxxxxxxxxxxx
yyyyyyyyyyyyyyyyyyyyyyyyy
zzzzzzzzzzzzzzzzzzzzzzzzzz

Scoring

This is , so the shortest answer in each language wins.

SpookyGengar

Posted 2017-11-08T22:09:32.820

Reputation: 1 617

4Output as list of lines? – totallyhuman – 2017-11-08T22:19:28.297

5Can we use the uppercase alphabet instead? – Uriel – 2017-11-08T22:20:28.843

9I was missing alphabet challenges! (but don't let Leaky Nun know) – Luis Mendo – 2017-11-08T22:32:48.157

9I worked very hard checking if it was a dupe and apparently it isn't – Blue – 2017-11-08T22:35:25.667

related, related – Jonathan Allan – 2017-11-08T23:09:00.707

3Trailing/leading newlines or spaces allowed? – Shaggy – 2017-11-08T23:14:22.210

4@totallyhuman that's up to you. – SpookyGengar – 2017-11-08T23:31:39.200

1@Uriel, I don't see why not. – SpookyGengar – 2017-11-08T23:31:53.093

@Shaggy, go for it. – SpookyGengar – 2017-11-08T23:32:28.147

3@SpookyGengar it's just not specified in the post; and people here tend to be strict about challenges specifications xD – Uriel – 2017-11-08T23:35:44.407

1

Should "create a program" read "create a program or function"? (see this meta post).

– Jonathan Allan – 2017-11-09T00:04:41.773

@Uriel, I totally understand. If you look at my other posts you'll see that I am very lax with my rules lol. – SpookyGengar – 2017-11-09T00:43:09.680

@JonathanAllan - interesting. I updated the post. – SpookyGengar – 2017-11-09T00:44:26.600

related – Poke – 2017-11-10T21:39:52.427

Answers

14

05AB1E, 2 bytes

Try it online!

Note that this outputs as a list of lines, as the OP explicitly allowed. The link uses a version with pretty-print (joined by newlines).

How it works

  • A yields the lowercase alphabet.
  • ƶ lifts the alphabet (multiplies each element by its index).
  • » joins by newlines.

Mr. Xcoder

Posted 2017-11-08T22:09:32.820

Reputation: 39 774

21

Python 2, 36 bytes

i=1
exec'print chr(i+96)*i;i+=1;'*26

Try it online!

totallyhuman

Posted 2017-11-08T22:09:32.820

Reputation: 15 378

9

APL (Dyalog), 12 8 5 bytes SBCS

3 bytes saved thanks to @ngn

4 bytes saved thanks to @Adám

⍴⍨⌸⎕A

OP clarified uppercase letters are valid, as well as output as an array of strings.

Try it online!

How?

gives us every letter in the ⎕A lphabet with its indexes in it, handed into the function ⍴⍨ with the letter as left argument and the indexes as right argument.

⍴⍨ resha es its right argument to the length supplied by its left one. switches the left and right (therefore the symbol of it, looking like the face of someone reading this explanation).

Uriel

Posted 2017-11-08T22:09:32.820

Reputation: 11 708

819⌶↑⎕A⍴¨⍨⍳26 – Adám – 2017-11-08T23:06:32.027

@Adám thanks! I tried all variations of / and , completely ignored shape ⍨ – Uriel – 2017-11-08T23:12:38.263

You can remove the too. – Adám – 2017-11-08T23:40:41.137

@Adám but it would look uglier ⍨ – Uriel – 2017-11-08T23:42:07.273

Turn boxing on! – Adám – 2017-11-08T23:42:44.457

Uh, in this case you can substitute with / for identical result. – Adám – 2017-11-08T23:43:40.050

But with ⍴ I can Sha⍴e (see what I did there?) – Uriel – 2017-11-08T23:46:25.243

Ah, ρeshapes. – Adám – 2017-11-08T23:48:37.447

Well, I take into account that most all people don't know the Greek alphabet. – Uriel – 2017-11-08T23:53:13.823

Pollard rho algorithm. Anyone know that also knows that is pronounced as "rho" (starts with r). – user202729 – 2017-11-09T13:09:43.860

hey, this is just ⍴⍨⌸⎕A – ngn – 2018-01-31T23:09:33.693

@ngn thanks! should use SBCS for that, right? – Uriel – 2018-01-31T23:25:15.770

@Uriel right, though I'm not sure what the rules are if it's published later than the challenge – ngn – 2018-01-31T23:43:10.090

@ngn newer-languages is a long gone standard. it's just not well known that it had gone. – Uriel – 2018-01-31T23:44:18.710

8

Haskell, 27 bytes

[c<$['a'..c]|c<-['a'..'z']]

Try it online! Returns a list of lines. (Thanks to @totallyhuman for pointing out that this is now allowed)

Explanation:

             c<-['a'..'z']  -- for each character c from 'a' to 'z'
[           |c<-['a'..'z']] -- build the list of
[   ['a'..c]|c<-['a'..'z']] -- the lists from 'a' to c, e.g. "abcd" for c='d'
[c<$['a'..c]|c<-['a'..'z']] -- with each element replaced by c itself, e.g. "dddd"

Laikoni

Posted 2017-11-08T22:09:32.820

Reputation: 23 676

*bows* Explanation for a noob? Does <$ repeat its first argument n times, where n is the length of its second argument? – totallyhuman – 2017-11-08T22:43:57.460

@totallyhuman There you go. Feel free to ask in Of Monads and Men if you have further questions.

– Laikoni – 2017-11-08T22:52:46.267

There are some very interesting operators in Prelude... Thanks for the explanation! – totallyhuman – 2017-11-08T22:54:04.880

7

brainfuck, 74 bytes

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

Try it online!

Explanation

++++++++[>+>+++>++++++++++++<<<-]>++>++>+>+
TAPE:
  000
  010   C_NEWLINE
  026   V_ITERCOUNT
  097   V_ALPHA
 >001<  V_PRINTCOUNT
  000   T_PRINTCOUNT

V_ITERCOUNT TIMES:      <<[-   

  V_PRINTCOUNT TIMES:     >>[-
    INC T_PRINTCOUNT        >+
    OUTPUT V_ALPHA          <<.
                          >]

  RESTORE V_PRINTCOUNT    >[-<+>]
  INC V_PRINTCOUNT        <+
  INC V_ALPHA             <+
  OUTPUT C_NEWLINE        <<.
                        >]

Try it online!

Conor O'Brien

Posted 2017-11-08T22:09:32.820

Reputation: 36 228

7

Befunge-98 (FBBI), 27 bytes

1+:0\::'`j'@+\k:$$>:#,_$a,

where is a substitution character (ASCII 26)

Try it online!

Uses uppercase letters, and has a trailing newline.

Explanation

The code works by storing a counter (0 initially), and on every loop:

  • 1+ - Increments it by 1
  • :0\:: - Pushes things so that the stack looks like this: bottom [N, 0, N, N, N] top
  • '`j'@ - Checks if the counter is greater than 26
    • j'@ - If it is, we jump over the ' and exit using @
    • j'@ - If it isn't, we execute the ', which pushes the ASCII value of @ to the stack

Now the stack looks like this: bottom [N, 0, N, N, 64] top

  • +\ - Adds, then switches the top 2: bottom [N, 0, (N+64), N] top The first time through, this is ASCII 65, or A
  • k: - Duplicates the second from the top (N+1) times - now there are (N+2) values of (N+64) on the stack (plus the N and 0 from earlier)
  • $$ - Throw away the top 2 values - now there are only N values of (N+64)
  • >:#,_ - Prints each top value until it gets to a 0 - this means N copies of (N+64) get printed
  • $ - Throws away the 0 - Now the stack is just N
  • a, - Prints an enter

And it repeats


I like how I used the @ both for ending the program and for adding to the counter.

MildlyMilquetoast

Posted 2017-11-08T22:09:32.820

Reputation: 2 907

@JamesHolderness Yep. Thanks for catching that! – MildlyMilquetoast – 2017-11-09T02:30:34.970

7

Ruby, 32 30 bytes

-2 bytes thanks to @EricDuminil.

27.times{|n|puts (n+96).chr*n}

Try it online!

Jordan

Posted 2017-11-08T22:09:32.820

Reputation: 5 001

1Excellent. According to a comment by OP, trailing/leading newlines are allowed. In that case 27.times{|n|puts (n+96).chr*n} would be correct with 30 bytes – Eric Duminil – 2017-11-09T09:59:48.157

6

JavaScript (ES6), 54 bytes

f=(n=9)=>++n<36?n.toString(36).repeat(n-9)+`
`+f(n):''

O.innerText = f()
<pre id=O></pre>

Arnauld

Posted 2017-11-08T22:09:32.820

Reputation: 111 334

6

Excel VBA, 38 bytes

Using Immediate Window. :)

[A1:A26]="=REPT(CHAR(96+ROW()),ROW())"

remoel

Posted 2017-11-08T22:09:32.820

Reputation: 511

Ah. My bad. I thought it's Excel because I used Excel Functions using Immediate Window. – remoel – 2017-12-19T02:58:09.837

You can drop a byte by removing the terminal " – Taylor Scott – 2018-01-30T17:48:52.580

5

Ruby, 38 bytes

Returns an Array of strings

->{(a=*?a..?z).map{|x|x*-~a.index(x)}}

-5 bytes thanks to totallyhuman

*-11 bytes thanks to some excellent golfing by Jordan.

displayname

Posted 2017-11-08T22:09:32.820

Reputation: 151

This is only 48 bytes by my count.

– Jordan – 2017-11-09T01:21:33.757

1

You don’t need "\n" at all; puts does that for you (though for future reference $/ is 2 bytes shorter)—but you can get rid of puts entirely if you make this a lambda that just returns an array of lines. You can also change a=[*?a..?z];puts a.map to puts (a=*?a..?z).map and x*(a.index(x)+1) to x*-~a.index(x). All together that’s 38 bytes.

– Jordan – 2017-11-09T01:28:22.483

The 38-byte version works fine on TiO (see link in previous comment). Note that the (a=*?a..?z) is inside the block, not the arguments part of the lambda. – Jordan – 2017-11-16T06:48:47.250

5

BASH, 59 54 40 bytes

for l in {a..z};{
a+=a
echo ${a//a/$l}
}

Try it online!

thx. 5 bytes to @Justin Mariner

Ipor Sircer

Posted 2017-11-08T22:09:32.820

Reputation: 333

1

The for loop can be golfed down using this tip for 54 bytes: Try it online!

– Justin Mariner – 2017-11-09T00:24:40.007

4

V, 9 bytes

¬az\ÓÎÛäl

Try it online!

Hexdump:

00000000: ac61 7a5c d3ce dbe4 6c                   .az\....l

James

Posted 2017-11-08T22:09:32.820

Reputation: 54 537

4

MATL, 9 bytes

2Y2"@X@Y"

Try it online!

Explanation

2Y2     % Push string 'abc...z'
"       % For char in that string each
  @     %   Push current char
  X@    %   Push iteration index (1-based)
  Y"    %   Run-length decoding: repeat char that many times
        % Implicit end. Implicit display

Luis Mendo

Posted 2017-11-08T22:09:32.820

Reputation: 87 464

Do you know why & can't be used to duplicate and transpose 2Y2?

– Stewie Griffin – 2017-11-09T14:27:37.160

@StewieGriffin & doesn't actually duplicate and transpose, although it sometimes produces the same result as that. What it does is modify the number of inputs/outputs of the next function. For example, if you use &+, the + function now takes one input instead of two, and outputs the sum of the input with itself transposed. But that's only because that's how + work with 1 input (same for =, > and some others) – Luis Mendo – 2017-11-09T15:55:19.977

4

Jelly,  5  4 bytes

sneaky Python implementation abuse

-1 byte thanks to Adám (outputting a list of lines has been allowed; as, now, has writing a function rather than a program)

Øa×J

A niladic link that returns a list of strings, the lines
(to print it with the newlines as a full program just add Y back in).

Try it online! (the footer calls the link as a nilad (¢) and gets the Python representation of the result (ŒṘ) for clarity as the default full-program behaviour would smash the result together like abbccc...)

How?

Øa×J - main link: no arguments
Øa   - yield the alphabet = ['a','b','c',...,'z']
   J - range of length    = [1,2,3,...,26]
  ×  - multiplication     = ["a","bb","ccc",...,"zzzzzzzzzzzzzzzzzzzzzzzzzz"]
     - (Python multiplication lengthens chars to strings - not usually a Jelly thing)

Jonathan Allan

Posted 2017-11-08T22:09:32.820

Reputation: 67 804

1Øa×J should be enough. – Adám – 2017-11-08T23:40:09.667

hmm, maybe - we may "output" a list of lines, but we must "create a program" - when running as a program the output of the four byter is smashed to have no indication of it's list nature. – Jonathan Allan – 2017-11-09T00:02:25.640

program or function – Adám – 2017-11-09T00:53:39.927

4

Japt, 9 7 bytes

Outputs an array of lines

;C¬Ëp°E

Try it


Explanation

Split (¬) the lowercase alphabet (;C) to an array of characters, map over the array (Ë) and repeat (p) the current element by the current index (E) incremented (°) times.

Shaggy

Posted 2017-11-08T22:09:32.820

Reputation: 24 623

Exactly what I had, except I used ®p°Y – ETHproductions – 2017-11-09T02:27:40.507

4

Python 3, 37 bytes

for k in range(27):print(chr(k+96)*k)

Prints a leading newline (which is allowed).

Try it online!

Luis Mendo

Posted 2017-11-08T22:09:32.820

Reputation: 87 464

4

Javascript, 87 bytes, 72 bytes (A lot of thank to @steenbergh)

My first answer too:

for(i=1,j=97;j<123;){console.log(String.fromCharCode(j++).repeat(i++))};

NTCG

Posted 2017-11-08T22:09:32.820

Reputation: 151

Welcome! Looks like you can shorten it a bit by removing the spaces around ind=1at the start, the semicolon after i<123 and the final semicolon. also, please make your header slightly more clear by stating language - bytecount, prefixed with a #. – steenbergh – 2017-11-09T12:58:53.353

You can save six bytes by dropping j altogether: for(i=1;i<27;){console.log(String.fromCharCode(i+96).repeat(i++))} – steenbergh – 2017-11-13T14:46:15.073

@steenbergh thank you once again, your how kind you are to help me. – NTCG – 2017-11-14T03:41:18.417

4

MATL, 11 bytes

2Y2t!g*!YRc

Try it online!

Uses broadcast multiplication with ones to get a big square 26x26 matrix of the desired letters. Next, the lower triangular part is taken, and implicitly printed.

Also 11 bytes:

2Y2!t~!+YRc  % Using broadcast addition with zeroes
2Y2!l26X"YR  % Using 'repmat'

Sanchises

Posted 2017-11-08T22:09:32.820

Reputation: 8 530

@StewieGriffin I was actually halfway commenting on your Octave answer on the coincidence of coming up with the same solution. – Sanchises – 2017-11-09T14:28:26.570

3

Perl 6,  24  23 bytes

.say for 'a'..'z'Zx 1..*

Try it

.say for 'a'..*Zx 1..26

Try it

Brad Gilbert b2gills

Posted 2017-11-08T22:09:32.820

Reputation: 12 713

3

Haskell, 31 bytes

-12 bytes thanks to nimi.

zipWith replicate[1..26]['a'..]

Try it online!

This is not a snippet, it is a nullary function (one that takes no arguments) that outputs a list of lines which is allowed because of this meta consensus.

totallyhuman

Posted 2017-11-08T22:09:32.820

Reputation: 15 378

3

Pip, 9 bytes

FczPcX++i

Try it online!

In pseudocode, this is

For-each c in z
    Print (c string-multiply ++i)

where z is preset to the lowercase alphabet and i is preset to 0.


Map-based solutions take one extra byte because they need the -n flag to display on multiple lines:

{aX++i}Mz
B X_+1MEz

DLosc

Posted 2017-11-08T22:09:32.820

Reputation: 21 213

3

Acc!!, 66 bytes

Count i while 26-i {
Count j while i+1-j {
Write 97+i
}
Write 10
}

Try it online!

With comments

# Loop i from 0 to 25
Count i while 26-i {
    # Loop j from 0 to i (inclusive)
    Count j while i+1-j {
        # Print a letter
        Write 97+i
    }
    # Print a newline
    Write 10
}

DLosc

Posted 2017-11-08T22:09:32.820

Reputation: 21 213

3

R, 38 bytes

A relatively uninteresting answer. Iterate for i from 1 to 26, print the ith letter of the alphabet i times (with an implicit line break).

for(i in 1:26)print(rep(letters[i],i))

Try it online!

A more interesting approach might be to use something like the following:

cat(letters[(1:351*2)^.5+.5])

This gives us all the letters in the right amount, but no linebreaks. Perhaps someone smarter than me can figure out a way to use that to make a golfier answer.

rturnbull

Posted 2017-11-08T22:09:32.820

Reputation: 3 689

2I'm not sure how to use your second approach, either, but I know that rep(letters, 1:26) is much shorter... – Giuseppe – 2017-11-09T14:14:52.723

@Giuseppe Hah! Like I said, "someone smarter than me" is definitely needed. – rturnbull – 2017-11-10T00:02:48.010

3

PHP, 47 46 bytes

for($c=a;$i<26;)echo"
",str_pad($c,++$i,$c++);

or

for($c=a;$i<26;)echo str_pad("
",++$i+1,$c++);

Run with -nr or try it online.

Titus

Posted 2017-11-08T22:09:32.820

Reputation: 13 814

3

Perl 5, 19 bytes

say$_ x++$"for a..z

Try it online!

Xcali

Posted 2017-11-08T22:09:32.820

Reputation: 7 671

3

J, 18 17 bytes

a.{~(#"0+&96)i.27

Explanation:

              i.27      - list of integers 0 - 26
     (   +&96)          - adds 96 to the above list (starting offset of 'a')
      #"0               - copies the right argument left argument times  
  {~                    - select items from a list (arguments reversed)
a.                      - the whole alphabet


#"0 +&96 is a hook, which means that at first +96 is applied to the list i.27,
resulting in a list 96, 97, 98... 122, then #"0 is applied to this result. 
So it is evaluated as ((i.27)#"0(96+i.27)){a:

Try it online!

Galen Ivanov

Posted 2017-11-08T22:09:32.820

Reputation: 13 815

3

Rust, 82 bytes

||for i in 1..27u8{println!("{}",((i+96) as char).to_string().repeat(i as usize))}

I had hoped that it would've been a lot shorter, but explicitly converting/casting between types takes a lot of bytes :(

Try it online!

Wakawakamush

Posted 2017-11-08T22:09:32.820

Reputation: 121

1

I got 76 bytes: Try it online!

– Conor O'Brien – 2017-11-16T18:32:08.433

3

Octave, 25 24 bytes

['',tril((x=65:90)'+~x)]

Try it online!

Saved one byte thanks to Giuseppe who informed me that OP allows upper case letters.

Explanation:

Create a vector x with the ASCII-values of the upper case alphabet, and transpose it. Add the negated x (thus 26 zeros, in a row vector, in order to create a grid with (the ASCII-values of):

AAAA
BBBB
CCCC

Take the lower triangular matrix and convert to characters by concatenating with the empty string.

Stewie Griffin

Posted 2017-11-08T22:09:32.820

Reputation: 43 471

3

C (gcc), 48 bytes 50 bytes

Re-runnable version, as per cleblanc and Steadybox in the comments below.

s[9];main(i){for(;i<27;)puts(memset(s,i+95,i++));}

Try it online!

gastropner

Posted 2017-11-08T22:09:32.820

Reputation: 3 264

1

Nice answer. I think your function will fail the next time it's called and according to this link it should be re-useable; https://codegolf.meta.stackexchange.com/questions/4939/do-function-submissions-have-to-be-reusable

– cleblanc – 2017-11-09T20:12:58.827

Here's a fixed version in 50 bytes: s[9];main(i){for(;i<27;)puts(memset(s,i+95,i++));} Still beats my answer by a few bytes :)

– Steadybox – 2017-11-10T10:44:59.110

49 bytes: s[9];main(i){for(;puts(memset(s,i+95,i++))-27;);}

– tsh – 2018-10-18T11:06:18.780

3

Japt, 17 16 11 bytes

-5 bytes thanks to Oliver

In ISO-8859-1

;26ÆCgX pXÄ

Not the best score, but I'm still a novice. Any suggestions are very welcome.

Outputs list of lines, as OP allowed. Link contains 3 bytes more for newlines.

Try it online!

;                      - Use string variables
 26                    - Literal 26
   Æ                   - For range 0..26
    C                  - Alphabet
     gX                -         . character at index X
        pXÄ            - Duplicate X+1 times
                       - End function (implicit)

RedClover

Posted 2017-11-08T22:09:32.820

Reputation: 719

1Nice! 1oBÊÄ can be replaced by 26õ. You can save a couple more bytes by doing something like ;26ÆCgX pXÄ – Oliver – 2017-11-10T19:33:35.663

@Oliver How the heck I didn't see that 26 is shorter than alphabet length?! Thanks. Also, my bad I didn't found that o takes the f argument... – RedClover – 2017-11-10T19:35:49.653

3

Brain-Flak, 107 bytes

((((()()()){}){}()){}){(({})){({}<(({})<({}((((()()()()){}){}){}){})>)>[()])}{}({}<((()()()()()){})>[()])}

Try it online!

This is 106 bytes of code, and +1 byte for the -A flag, which enables ASCII output.

Explanation:

#Push 26
((((()()()){}){}()){})

#While True...
{

    #Duplicate A
    (({}))

    #While True...
    {
        #Grab the value of A...
        ({}<

            #Make a duplicate of B (on the first loop, B == A)
            (({})<

                #Push B + 
                ({}

                #64 (ASCII 'A' - 1)
                ((((()()()()){}){}){}){})

            #Then push B on top of all of that
            >)

        #Push A - 1 on top of all of that
        >[()])

    #Endwhile, pop the loop counter
    }{}

    #Underneath A,
    ({}<

        #Push 10
        ((()()()()()){})

    # Then Push A - 1
    >[()])

#Endwhile
}

James

Posted 2017-11-08T22:09:32.820

Reputation: 54 537

3

Brainfuck, 107 104 94 Bytes

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

How it works:

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

Stores 26 on the second cell, 65 on the third cell, 10 on the sixth cell, and 1 on the fourth, leaving the pointer on the fourth (Saved 3 13 bytes by making 26, 10, and 97 65 at the same time).

[<]>

Moves the pointer back to the start.

Now we're ready to get started!

[                       | While the first cell is non-zero (so 26 times)
>>                      | Move to cell 3
    [                   | While cell 3 is non-zero
        <.>>+<-         | Print cell 2, increment cell 4, and decrement cell 3
    ]                   |
    >>.<<               | Move to cell 5 and print it (new line), then return
    <+>+>               | Increment cells 2 and 3, and move to 4
    [<+>-]              | Add the value at 4 to 3
<<<-                    | Decrement cell 1
]                       |

The important part is that cell 3 stores the number of times to print a letter. Each time a letter is printed, the value at 3 is moved to 4 and increased by 1, so that the next number is printed one more time than the last.

Side Note:

I'm completely new to brainfuck, so I wouldn't be surprised if this could be improved. However, I was also surprised by how fun brainfuck is to write, as well as by how easy it was to write, when compared with what I had imagined.

I would definitely recommend learning brainfuck to any bored programmers out there ;)

Bolce Bussiere

Posted 2017-11-08T22:09:32.820

Reputation: 970

If you’re fine with negative cells, you can save 4 bytes at the beginning – Jo King – 2017-12-19T02:41:53.823

2

Pyke, 5 bytes

G Foh*

Try it here!

       - o=0
G      -  alphabet
  F    - for i in ^:
     * -  ^ * v
   oh  -   (o++)+1

Blue

Posted 2017-11-08T22:09:32.820

Reputation: 26 661

Is there supposed to be a space between G and F? – caird coinheringaahing – 2017-11-08T22:42:27.530

That's just in the readable version, in the link, that's changed into a single byte and that's just the 2 byte representation I've used – Blue – 2017-11-08T23:14:49.453

2

Jelly, 7 6 bytes

ØaxJŒg

Try it online!

Returns a list of lines

How it works

ØaxJŒg - Main link. No arguments
Øa     - Lower case alphabet
  x    - each repeated...
   J   - range(len) times (vectorises)
    Œg - group equal runs

An alternative (which I prefer, but is longer):

ØaḊLСUZYṚ

Try it online!

caird coinheringaahing

Posted 2017-11-08T22:09:32.820

Reputation: 13 702

5 bytes – dylnan – 2018-05-15T05:07:58.927

2

Befunge, 37 35 bytes

:"a"+:>,#:\:#->#1_55+,$"`"-:55*`#@_

Try it online!

Explanation

The program starts with an implicit zero on the stack, representing the repeat count (off by 1).

:"a"+                                Duplicate the count and convert it to a character.
     :                               Duplicate the character prior to writing it out.

      >                              Start the output loop.
       ,                             Write the duped character to stdout.
          \                          Swap the count to the top of the stack.
           :  >  _                   Duplicate it and check if zero, returning left if not.
             -  1                    Decrement the count.
          \                          Swap the character back to the top.
         :                           Duplicate it prior to writing it out again.
      >                              Repeat the loop.

                 _                   If the count reached zero, we continue right.
                  55+,               Output a linefeed.
                      $              Drop the zero count.
                       "`"-          Convert the character to a numeric count and increment.
                           :55*`     Check if greater than 25.
                                #@_  If so, then terminate, else wrap back to the start.

James Holderness

Posted 2017-11-08T22:09:32.820

Reputation: 8 298

I feel like this could almost be golfed further by combining the \ before the loop with the \ inside the loop, but it screws too much up – MildlyMilquetoast – 2017-11-09T01:49:12.180

Whoops! Yeah, I meant the \\s. Apparently I have to escape them. EDIT: I have no clue how code snippets in comments work – MildlyMilquetoast – 2017-11-09T02:26:12.760

@MistahFiggins Did a bit of fiddling to try and combine the swaps, and while that didn't help with the size of the inner loop, it did enable me to get rid of the 2+ increment at the start, saving a couple of bytes. So thanks for pushing me to look at it again. – James Holderness – 2017-11-09T04:33:32.933

2

VBA, 33 Bytes

Anonymous VBE immediate window function that outputs to the VBE immediate window

For i=1To 26:?String(i,96+i):Next

Taylor Scott

Posted 2017-11-08T22:09:32.820

Reputation: 6 709

Hey, cool to see you can skip chr$() in the call to String(). – steenbergh – 2017-11-09T13:04:39.727

2

Java (OpenJDK 8), 74 bytes

n->{for(int i=1,j=0;i<27;)System.out.printf("%c",j++<i?96+i:10+(j-=++i));}

Try it online!

6 bytes saved thanks to @KevinCruijssen

Explanations

n->{                      // Lambda, unused parameter
 for(int i=1,j=0;i<27;)   // Loop from 1 to 26 included
  System.out.printf("%c", // Print a character
   j++<i                  // Do we need to print a letter or a new line?
    ?96+i                 // It's a character, construct it.
    :10+(j-=++i)          // It's a new line, increment i and reset j to 0.
  );
}

Olivier Grégoire

Posted 2017-11-08T22:09:32.820

Reputation: 10 647

You can save a byte by doing the s+=" " and print separately: n->{String s="";for(char i=96;++i<123;System.out.println(s.replace(' ',i)))s+=" ";} – Kevin Cruijssen – 2017-11-09T08:08:37.653

Also, kinda cheating imo due to two leading new-lines, but n->{String s="\n",r=s;for(char i=96;++i<123;r+=s.replace(' ',i))s+=" ";return r;} (81 bytes) would also be possible. OP said in the comments trailing/leading spaces/new-lines are allowed, but I'm not sure if more than 1 is allowed.

– Kevin Cruijssen – 2017-11-09T08:18:11.390

1

Sorry for all the comments, but this time without leading new-lines and shorter (and uppercase): n->{String r="";for(char c=64,i;++c<91;r+="\n")for(i=64;i++<c;r+=c);return r;} (78 bytes) Got inspired by an old answer of mine. :)

– Kevin Cruijssen – 2017-11-09T09:14:33.683

@KevinCruijssen It's only fair to have provided many answers: I reckon I often do it as well ;-) Thanks for this golf! – Olivier Grégoire – 2017-11-09T09:45:39.230

@Oliver I worked on trying to make it shorter for quite some time and was unable to. However I thought you might find this interesting. Incrementing starting at 97 (ASCII for 'a') does not shorten the byte count :( I could only get it down to 79 on my best attempt:

a->{for(int i=97,j=96;i<123;)System.out.printf("%c",j++<i?i:106-(j=j-++i+96));} – DevelopingDeveloper – 2017-12-19T21:07:08.873

@DevelopingDeveloper Yep, golfing is hard. ;) – Olivier Grégoire – 2017-12-21T09:46:14.860

2

C# (.NET Core), 78 bytes

n=>{var s="";for(int i=1;i<27;)s+=new string((char)(i+96),i++)+'\n';return s;}

Try it online!

Ian H.

Posted 2017-11-08T22:09:32.820

Reputation: 2 431

2

Mathematica, 33 bytes

Alphabet[][[#]]~Table~#&~Array~26

Try it online!

J42161217

Posted 2017-11-08T22:09:32.820

Reputation: 15 931

2

Stacked, 14 bytes

[26~>:96+chr*]

Try it online!

Pushes a list of lines to the stack.

Explanation

[26~>:96+chr*]
[            ]  anonymous function, takes no arguments
 26~>           range from 1 to 26
     :96+       push range from 97 to 122 (97..122')
         chr    convert each of these to a char ('a'..'z')
            *   repeat each char by the former amount ('a' 'bb' 'ccc' ...)

Conor O'Brien

Posted 2017-11-08T22:09:32.820

Reputation: 36 228

2

C (gcc), 53 bytes

i,j;f(){i=i-putchar(j++-i?96+i:(j=!++i)+10)-16&&f();}

Prints a leading newline. Has undefined behaviour, but works with gcc...

Try it online!

C, 54 bytes

j;main(i){for(;i<27;)putchar(j++-i?96+i:(j=!++i)+10);}

Try it online!

C, 54 bytes

i,j;f(){putchar(j++-i?96+i:(j=!++i)+10);(i%=27)&&f();}

Prints a leading newline.

Try it online!

C, 56 bytes

main(i,j){for(;i<27;)for(j=++i;j--;)putchar(j?95+i:10);}

Try it online!

Steadybox

Posted 2017-11-08T22:09:32.820

Reputation: 15 798

j;main(i){for(;i<28;putchar(j?95+i:10))j=j?j-1:i++;} (52 bytes) almost works. – Steadybox – 2017-11-09T01:19:50.837

2

Charcoal, 6 bytes

Eβ×ι⊕κ

Try it online! Link is to verbose version of code. Explanation:

     κ  Index
    ⊕   Incremented
   ι    Character
  ×     Repeated
 β      Lowercase letters
E       Map over each character
        Implicitly print each result on its own line

Neil

Posted 2017-11-08T22:09:32.820

Reputation: 95 035

2

Japt, 9 bytes

;C£RiXpYÄ

Try it online!

Oliver

Posted 2017-11-08T22:09:32.820

Reputation: 7 160

2

Retina, 20 bytes

:`
a
{2`
$`
T:`_l`l_

Try it online!

Prints a couple of trailing linefeeds.

Explanation

:`
a

Initialise the string to a and print it.

{2`
$`

The { tells Retina to loop the remainder of the program until it fails to change the string. The stage itself duplicates the first character.

T:`_l`l_

This increments all letters using transliteration and prints the result.

Martin Ender

Posted 2017-11-08T22:09:32.820

Reputation: 184 808

2

Brachylog, 7 bytes

Ại₁j₎ẉ⊥

Try it online!

Explanation

Ạ         The alphabet string "abcdefghijklmnopqrstuvwxyz"
 i₁       A couple: [a letter of the alphabet, its index (1-indexed) in it]
   j₎     Juxtapose that letter as many times as its index
     ẉ    Write followed by a linebreak
      ⊥   False: try another couple of [letter, index]

Fatalize

Posted 2017-11-08T22:09:32.820

Reputation: 32 976

2

Elixir, 47 bytes

for x<-?a..?z,do: IO.puts List.duplicate x,x-96

Try it

Shashidhar Mayannavar

Posted 2017-11-08T22:09:32.820

Reputation: 121

2

JavaScript, 65 bytes

for(x=0;x<26;)console.log(String.fromCharCode(x+97).repeat(++x));

old:

for(x=0;x<26;x++)console.log((function p(a,b){return b==0?a:a+p(a,--b);})(String.fromCharCode(97+x),x));

xDest

Posted 2017-11-08T22:09:32.820

Reputation: 31

2

Common Lisp, 65 bytes

(dotimes(a 26)(format t"~v@{~a~:*~}~%"(1+ a)(code-char(+ a 97))))

Try it online!

Renzo

Posted 2017-11-08T22:09:32.820

Reputation: 2 260

2

C# (.NET Core), 84 bytes

()=>{return A(1);string A(int n)=>new string((char)(n+96),n)+(n<26?"\n"+A(++n):"");}

Try it online!

A recursive approach using a local function (given no inputs were allowed).

UnGolfed

()=>{
    return A(1);
    string A(int n) => new string((char)(n+96), n) +
                       (n < 26? "\n" + A(++n) : "");
}

Ayb4btu

Posted 2017-11-08T22:09:32.820

Reputation: 541

Nice one. Recursion is hard in C#. I just found a solution in 57 bytes :p

– aloisdg moving to codidact.com – 2017-11-10T15:39:06.407

2

C# (.NET Core), 57 bytes

57 bytes with a a trailling line

()=>new int[27].Select((_,i)=>new string((char)(i+96),i))

59 bytes without a trailling line

()=>new int[26].Select((_,i)=>new string((char)(i+++97),i))

Try it online!

I am using using System.Linq;

  • The int[x].Select() can be found here.

aloisdg moving to codidact.com

Posted 2017-11-08T22:09:32.820

Reputation: 1 767

Nicely done. I'm going to have to learn this Select trick. (I would have thought it would need to be wrapped in string.Join("\n",...) though.) – Ayb4btu – 2017-11-10T22:48:17.470

OP allows list :) – aloisdg moving to codidact.com – 2017-11-11T09:14:32.203

That simplifies things, and shows me for not reading the question comments. – Ayb4btu – 2017-11-11T09:43:27.090

2

CJam, 13 bytes

26{)_96+c*N}%

Explanation:

26             e# push 26
  {        }%  e# for n in 0 .. 25:
   )           e#   increment
     96+       e#   add 96
        c      e#   convert to character
    _    *     e#   repeat that character n+1 times
          N    e#   add a newline

Esolanging Fruit

Posted 2017-11-08T22:09:32.820

Reputation: 13 542

2

Underload, 62 bytes

()(::(.)~^(.):*:*:*:*:*::***( )*~^S(
)S(:)~*(*)*):*::*:*::***^

Try it online!

This is really stretching the limits of what's allowed.

It outputs a list of lines represented by strings (allowed by the OP), where the strings are lists of bytes (allowed by meta consensus), where the bytes are given in unary (also allowed by meta consensus).

The result is... well, see for yourself.

Esolanging Fruit

Posted 2017-11-08T22:09:32.820

Reputation: 13 542

2

Kotlin, 56 bytes

for(c in 'a'..'z'){for(j in 0..c-'a')print(c);println()}

Try it online!

alves

Posted 2017-11-08T22:09:32.820

Reputation: 141

I don't understand. Isn't this a valid full Kotlin program? Just drop it on a .kts file and it will run as is. – alves – 2017-11-26T00:06:46.193

48 bytes as a function. – ovs – 2017-11-26T14:01:15.763

@Steadybox are you are aware that Kotlin can run in script mode, in which case it doesn't need to declare the main function?

– alves – 2017-11-26T21:28:35.310

@ovs Nice! Your solution is much better than mine. I'll vote yours. – alves – 2017-11-26T21:43:38.563

@alves No, I wasn't. Sorry for the confusion. – Steadybox – 2017-11-26T22:06:49.270

2

Befunge 2x24 = 48 Bytes

I know the other befunge answer has me solidly beat, but I thought I'd post my solution anyway, as it's interesting, since it's partially self-modifying.

"z`"-:!_> 10g\v v!:_0# p
g01+55$_^#!:-1<@_,1^01-1

Try It Online

How it works

"?`"-:!

Gets how many times to iterate. (The question mark represents the current letter)

        _> 10g\v
        _^#!:-1<

Adds the iteration size*char into the stack.

                   _0# p
g01+55$_           ^01-1 

Pops the excess character and adds a newline. Gets the current character from 1,0 and decrements it, putting back at 1,0

"?`"-:!_           _0# p

Now the ? inside the quotes has been decremented. Once it has run through all the letters it runs backwards from the underscore, which was the tricky part. ! inverts the excess 0 to a 1, which is duplicated and subtracted from itself, turning it back to a 0. The 0 is put at (97,97) thanks to the backticks inside the quotes and the put command. This leaves just the original iteration size, which is 0, when it hits the underscore, pushing the pointer left.

                v!:_
               @_,1^

Prints out the whole stack, which at this point is a newline separated alphabet staircase.

Jo King

Posted 2017-11-08T22:09:32.820

Reputation: 38 234

2

Kotlin, 37 bytes

{(1..26).map{"${'`'+it}".repeat(it)}}

Try it online!

Returns a List of Strings

ovs

Posted 2017-11-08T22:09:32.820

Reputation: 21 408

This is a nice solution but is it ok to just return a list of Strings, without printing them? I'm still new to the code golf rules... – alves – 2017-11-26T21:47:51.310

@alves The OP verified this in a comment. Usually these rules should be in the post itself, but it is always useful to look in the comments.

– ovs – 2017-11-26T21:50:25.433

1

Pyth, 7 bytes

.e*hkbG

Try it online!

Outputs a list of lines. If that's not allowed, add a j to the start and let me know to add one byte to the count!


.e*hkbG  Full program - outputs to stdout
.e       map over
      G  the alphabet,
  *  b   repeating each letter
   hk    according to its index+1

Dave

Posted 2017-11-08T22:09:32.820

Reputation: 432

1

JavaScript, 113 bytes

(function(){var i=0,j=0,s;while(++i<=26){s="";j=0;while(++j<=i)s+=String.fromCharCode(96+i);console.log(s);}})();

Creta

Posted 2017-11-08T22:09:32.820

Reputation: 11

1

Tcl, 80 bytes

set a 97;time {time {puts -nonewline [format %c $a]} [incr i];puts "";incr a} 26

Try it online!

sergiol

Posted 2017-11-08T22:09:32.820

Reputation: 3 055

1

Funky, 42 bytes

fori=1i<27i++print("a".char(96+i)::rep(i))

Try it online!

ATaco

Posted 2017-11-08T22:09:32.820

Reputation: 7 898

1

C++, 56 bytes

for(char a='a';a<='z';++a)cout<<string(a-'a'+1,a)<<endl;

Try it online

user68468

Posted 2017-11-08T22:09:32.820

Reputation:

2C/C++ submissions need to be full programs or functions, not just snippets. – MD XF – 2017-11-10T04:54:34.377

2@MDXF All submissions need to be. :P – totallyhuman – 2017-11-10T14:50:48.770

@MDXF Let see https://codegolf.stackexchange.com/a/147497/68468 - Java code needs at least public class Main { public static void main(String[] args) { .... - is that answer correct?

– None – 2017-11-10T15:10:56.503

1@Harry Full programs or functions. That's an anonymous function or lambda. It's correct. Either way, regardless of the validity of another's submission, please delete yours, as it is invalid. – MD XF – 2017-11-10T17:47:52.883

[](){for(char a='a';a<='z';++a)cout<<string(a-'a'+1,a)<<endl;}() - is this lambda OK? – None – 2017-11-10T17:53:55.447

The lambda is almost valid, but you need to include the #include<iostream> and the using namespace std; in the bytecount because the code doesn't work without them. Also, you don't need to call the lambda, just define it. Change the trailing () to ;. Try it online! 73 bytes + 19 for the #include = 92 bytes

– Steadybox – 2017-11-25T13:16:17.503

Actually, the ; isn't counted either, since it's not part of the lambda expression. – Jakob – 2017-11-30T05:12:24.287

1

QBIC, 23 bytes

[26|[a|?chr$(a+96)';`]?

Explanation

[26|   FOR a = 1 TO 26
[a|      FOR b = 1 TO a
?chr$(     PRINT the character
a+96)         a, or b, or c depending on outer loop
';`           and suppress new-lines, tabs etc
]          NEXT, for this character (a, bb, ccc)
?          PRINT a newline between a, bb, ccc....
       NEXT on outer loop added implicitly

steenbergh

Posted 2017-11-08T22:09:32.820

Reputation: 7 772

1

K (oK), 16 bytes

Solution:

`c$t#'96+t:1_!27

Returns a list of lists. TIO prints to stdout:

Try it online!

Explanation:

`c$t#'96+t:1_!27 / the solution
             !27 / til 27, creates range of 0..26
           1_    / drop first element, 1..26 (could have done 1+!26 but 1_!26 is faster ;))
         t:      / store in variable v
      96+        / add 96 to each (97=a)
   t#'           / t take each, 1#97 = 97, 2#98 = 98 98, 3#99 = 99 99 99 etc
`c$              / cast to characters

streetster

Posted 2017-11-08T22:09:32.820

Reputation: 3 635

1

PowerShell, 30 bytes

1..26|%{"$([char]($_+96))"*$_}

Try it online!

Also 30 bytes --

1..26|%{(""+[char]($_+96))*$_}

Try it online!

In either case, we're just looping 26 times, each iteration constructing a string of the appropriate character, then string-multiplying it out to the appropriate length. Ho-hum.

AdmBorkBork

Posted 2017-11-08T22:09:32.820

Reputation: 41 581

1

T-SQL, 68 bytes

Using a variable and loop:

DECLARE @ INT=1;a:PRINT REPLICATE(CHAR(@+96),@)SET @+=1IF @<27GOTO a

Longer (94 bytes), but feels much more SQL-like, using a recursive CTE to generate a number table:

WITH t AS(SELECT 1n UNION ALL SELECT n+1FROM t WHERE n<26)
SELECT REPLICATE(CHAR(n+96),n)FROM t

BradC

Posted 2017-11-08T22:09:32.820

Reputation: 6 099

1

Check, 26 bytes

 >#v
#d##)::>96+]*o<:>26-?

Try it online!

Explanation:

Check's gimmick is that it can switch between 2D semantics (for control flow) and 1D semantics (for stack manipulation). The program starts out at the beginning of the program in 1D semantics.

> pushes 0 to the stack. # switches to 2D semantics and v directs the IP downwards. It then hits #, switching back to 1D semantics for the main loop.

#d##)::>96+]*o<:>26-?

The commands before the ? go like this:

#    1D mode:                   0
)    increment:                 1
:    duplicate:                 1, 1
:    duplicate:                 1, 1, 1
>96  push 96:                   1, 1, 1, 96
+    add:                       1, 1, 97
]    wrap:                      1, 1, [97]
*    repeat:                    1, [97]
o    output char codes ("a"):   1
<    output newline ("\n"):     1
:    duplicate:                 1, 1
>26  push 26:                   1, 1, 26
-    subtract:                  1, -25

The ? is Check's only branching operator. It switches to 2D semantics if the TOS is nonzero, and stays in 1D semantics otherwise. In this case, if the top stack value is 0, then the program ends, and if it is negative, then it goes around to the beginning. # switches back to 1D semantics, d deletes the top stack element (since ? does not pop it). ## switches to 2D and then back again, and then the loop restarts.

Esolanging Fruit

Posted 2017-11-08T22:09:32.820

Reputation: 13 542

1

Vim, 33 Keystrokes

:h<_␍jjYZZiyl0pr␛pqq{<C-a>YG@"q25@q{D

Explanation

:h<_␍jjYZZ                             " get a-z 
          iyl0pr                       " Put yl0pr as macro line 
                ␛p                     " Back to normal mode and paste
                  qq                   " Record macro
                    {                  " Go to macro line 
                     <C-a>             " Increment counter
                          Y            " Yank the macro
                           G           " Go to last line
                            @"         " Run the macro (also adds \r)
                              q        " Stop recording @q
                               25@q    " Run @q 25 times
                                   {D  " go to top and clear the line

Had experimented with this which inspired the above Macro line:

:h<_␍jjYZZP:exe ":norm yl".line('.')."ps^M"␍25@:

Thought about putting a-z on separate lines and global replace with repeat, but can't make :%s/./\=repeat(\0,line('.'))/g work -- and that's long.

Sunny Pun

Posted 2017-11-08T22:09:32.820

Reputation: 821

1

brainfuck, 70 59 bytes

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

Try it online!

-<--[[<+>->----<]++>]<-<-<<
Sets the tape up as:
     254
     9    Newline (10-1)
     230' Loop counter (-26)
     114  
     65   Character (A)
     1    Repeat counter
[ Loop 26 times
   >>>[-<.>>+<]   Print the character repeat counter times while preserving the counter
   >[-<+>]        Restore counter
   <[+<]          Increment everything
   >->.->         Print a newline
]

Jo King

Posted 2017-11-08T22:09:32.820

Reputation: 38 234

1

R, 33 bytes

cat(strrep(letters,1:26),sep="
")

Try it online!

This challenge got bumped to main; I tried a strrep approach which was happily shorter than the other existing R answer.

Giuseppe

Posted 2017-11-08T22:09:32.820

Reputation: 21 077

Or as a list of lines for the same count ? TIO

– JayCe – 2018-10-23T17:57:53.233

@JayCe Or just with letters instead of utf8 which is shorter... – Giuseppe – 2018-10-23T18:09:16.293

Of course why am I over-complicating things? – JayCe – 2018-10-23T19:55:58.870

0

Lua, 48 bytes

for i=1,26 do print(string.char(i+96):rep(i))end

Try it online!

Explanation:

  1. for i=1,26 do ... end — try all numbers between 1 and 26.
  2. print(...) — prints, of couse.
  3. string.char(i+96) — get alphabet char number i.
  4. :rep(i) — repeat char i times.

val says Reinstate Monica

Posted 2017-11-08T22:09:32.820

Reputation: 409

You can replace string with ("") to save 2 bytes. – ATaco – 2017-11-22T01:22:29.330

0

Acc!!, 74 bytes

97
Count i while i-27 {
 	Count t while t-i {
 		Write _+i-1
	}
Write 10
}

Try it online!

FantaC

Posted 2017-11-08T22:09:32.820

Reputation: 1 425

0

Wolfram Language (Mathematica), 43 bytes

This submission creates the specified output string exactly - in other words, it's NOT an array of string-enclosed characters.

#~Table~#2<>"\n"&~MapIndexed~Alphabet[]<>""

Try it online!

Kelly Lowder

Posted 2017-11-08T22:09:32.820

Reputation: 3 225

I guess my answer needs 44 bytes to do this... ""<>Array[Alphabet[][[#]]~Table~#<>"\n"&,26] – J42161217 – 2017-11-11T12:58:18.800

0

Pushy, 8 bytes

Z26:q&Kh

Try it online!

Z          \ Push 0 to the stack
 26:       \ 26 times do:
    q      \    Print stack, with each number as its letter in the 0-indexed lower alphabet
     &     \    Make a copy of the last number
      Kh   \    Increment all numbers

FlipTack

Posted 2017-11-08T22:09:32.820

Reputation: 13 242

0

Kotlin, 76 bytes

for(i in 0..25){var j=0;while(j<=i){print((i+97).toChar());j++};print("\n")}

Try it online!

Trenton Telge

Posted 2017-11-08T22:09:32.820

Reputation: 21

0

C (gcc), 68 64 bytes

I know there's another C answer but this is a different approach

n=65;main(i){for(i=n;i-->64;putchar(n));++n>90||main(puts(""));}

Try it online!

cleblanc

Posted 2017-11-08T22:09:32.820

Reputation: 3 360

0

x86-64 machine code function, 19 bytes

18 bytes for x86-32 with a non-standard calling convention, inc eax is only 1B vs. 2B.

Callable from C (with the x86-64 System V calling convention) as:

void alphabet_staircase(char output[377]);

// or
struct string_result { char buf[377]; }  \
  alphabet_staircase(void);   // return-value pointer passed as implicit first arg

i.e. it stores a flat string (including '\n' newlines) into a buffer pointed to by rdi.

0000000000400080 <alphabet_staircase>:
  400080:       6a 61           push   0x61
  400082:       58              pop    rax      ; eax = 'a'

0000000000400083 <alphabet_staircase.loop>:
                                 ;;; do {
  400083:       8d 48 a1        lea    ecx,[rax-0x5f]      ; rax-'a'+1 + 1
  400086:       f3 aa           rep stos BYTE PTR es:[rdi],al
  400088:       c6 47 ff 0a     mov    BYTE PTR [rdi-0x1],0xa
  40008c:       ff c0           inc    eax
  40008e:       3c 7a           cmp    al,0x7a
  400090:       76 f1           jbe    400083 <alphabet_staircase.loop>
                                 ;;; } while(al <= 'z')
  400092:       c3              ret

  400093  end of function.  0x93 - 0x80 = 0x13 = 19 bytes

Try it online! (including a _start caller that prints the result with sys_write())

In each loop iteration, we store one extra copy of current letter, then overwrite it with a newline. rep stosb = memset(rdi, al, rcx). It advances rdi to point one-past-the-end of the bytes it stored.

eax holds the current letter, and we use it as the loop counter. do {} while(eax <= 'z');. Setting rcx from it with LEA requires that the upper bytes of eax be zeroed, otherwise we could use 2-byte mov al, 'a' to start.

The x86-64 SysV ABI requires that DF is cleared on function entry/exit, so we don't need cld. If we wanted to use std to store backwards, it wouldn't solve the problem of needing an offset of one in an addressing mode to store the newline (or needing a separate inc/dec, or swapping eax with a reg holding 0x10 and using stosb to store a newline); stosb always overwrites the memory rdi is pointing to.

Peter Cordes

Posted 2017-11-08T22:09:32.820

Reputation: 2 810

0

Ruby, 28 31 35 bytes

Edit: saved 3 bytes by using a number range instead of letters. Try it online!

(0..26).map{|l|(l+96).chr*l}

Edit: saved 4 bytes by using the character number instead of looping with index. Try it online!

('`'..'z').map{|l|l*(l.ord-96)}

Edit: saved 6 bytes by outputting a list. Try it online!

('`'..'z').map.with_index{|l,i|l*i}

Original:

('`'..'z').each_with_index{|l,i|puts l*i}

Ben Aubin

Posted 2017-11-08T22:09:32.820

Reputation: 121

0

F# (.NET Core), 58 bytes

58 bytes

[1..26]|>Seq.map(fun i->new System.String((char)(i+96),i))

Try it online!

A basic port of my C# answer.

59 bytes

[1..26]|>Seq.map(fun i->[1..i]|>Seq.map(fun _->i+96|>char))

Try it online!

Same answer as above but without `System.String.

aloisdg moving to codidact.com

Posted 2017-11-08T22:09:32.820

Reputation: 1 767

0

Javascript (ES6) 61 bytes

_=>[...Array(26)].map((_,i)=>(10+i).toString(36).repeat(i+1))

Javascript (ES6) 62 bytes

_=>[..."abcdefghijklmnopqrstuvwxyz"].map((v,i)=>v.repeat(i+1))

I'm aware there's a better answer already for js, still wanted to post these, feel free to suggest any improvement as long as it keeps the "methodology" intact. (for readability im using underscores for unused variables)

Brian H.

Posted 2017-11-08T22:09:32.820

Reputation: 513

0

JsFuck, 7929c

[][(![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]]+([![]]+[][[]])[+!![]+[+[]]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[!![]+!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(![]+[])[+!![]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]]([!![]]+[][[]]+[][[]]+!![])[(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+!![]]]([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((![]+[])[+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]()[+!![]+[+!![]]]+(+!![])+(+[])+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]]+(!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]]+[])[!![]+!![]+[+[]]]+[][[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]()[+!![]+[+!![]]]+([]+[])[(![]+[])[!![]+!![]+!![]]+([][[]]+[])[+[]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]]()[+!![]+[+[]]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(!![]+[])[!![]+!![]+!![]]+(+(+!![]+[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+!![])+(+[]))+[])[+!![]]+(![]+[])[!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(+[]+[![]]+([]+[])[([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]])[!![]+!![]+[+[]]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[!![]+!![]+!![]]]+(![]+[])[+[]]+(+(+!![]+[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+!![])+(+[]))+[])[+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([]+[])[([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]][([][[]]+[])[+!![]]+(![]+[])[+!![]]+([]+(+[])[([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]])[+!![]+[+!![]]]+(!![]+[])[!![]+!![]+!![]]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[!![]+!![]+!![]]]+(!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+(+[]+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]]+(+(+!![]+[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+!![])+(+[]))+[])[+!![]]+(!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]]+[])[!![]+!![]+[+[]]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[+!![]])()([][[]]))[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[!![]+!![]+!![]]]+(+(+!![]+(!![]+[])[!![]+!![]+!![]]+(+!![])+(+[])+(+[]))+[])[!![]+!![]]+(+(+!![]+(!![]+[])[!![]+!![]+!![]]+(+!![])+(+[])+(+[]))+[])[!![]+!![]]+(![]+[])[+[]]+(+((+(+!![]+[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+!![])+(+[]))+[])[+!![]]+(+[])+(+[])+(+[])+(+[])+(+[])+(+[])+(+[])+(+[])+(+[])+(+!![]))+[])[!![]+!![]]+(+!![])+(+[])+(+[]+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]]+(+[]+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]])())

From

[].slice.call('trueundefinedundefinedtrue').filter([].filter.constructor('f=10\nreturn undefined=>console.log(f.toString(36).repeat(++f-10))')())

JsFuck, 7961c

[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]]+[])[!![]+!![]+[+[]]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(![]+[])[+!![]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]]+[])[!![]+!![]+[+[]]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[+!![]])()([][[]]))[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]])()(((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+![]+(!![]+!![])+(+[])+(![]+[])[+[]]+![]+(!![]+!![]+!![])+([][[]]+[])[!![]+!![]]+![]+(!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+[])[+[]]+![]+(!![]+!![]+!![])+([][[]]+[])[!![]+!![]]+(+!![])+(+[])+![]+(!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![])+([][[]]+[])[!![]+!![]]+![]+(!![]+!![]+!![])+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+![]+(!![]+!![])+([][[]]+[])[!![]+!![]]+(!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![])+(![]+[])[+[]]+(!![]+[])[+[]]+![]+(!![]+!![])+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+![]+(!![]+!![]+!![]+!![]+!![]+!![])+(![]+[])[+[]]+![]+(!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![])+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+![]+(!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![])+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+(+[])+(!![]+[])[!![]+!![]+!![]]+(![]+[])[+!![]]+(!![]+[])[+[]]+![]+(!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(+(+!![]+(!![]+[])[!![]+!![]+!![]]+(+!![])+(+[])+(+[]))+[])[!![]+!![]]+(+(+!![]+(!![]+[])[!![]+!![]+!![]]+(+!![])+(+[])+(+[]))+[])[!![]+!![]]+(!![]+[])[+[]]+![]+(!![]+!![])+([][[]]+[])[!![]+!![]]+(+!![])+(+[])+![]+(!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(+(+!![]+(!![]+[])[!![]+!![]+!![]]+(+!![])+(+[])+(+[]))+[])[!![]+!![]]+![]+(!![]+!![]+!![]+!![]+!![]+!![])+(+[])+![]+(+[])+(![]+[])[+!![]]+![]+(!![]+!![]+!![]+!![]+!![]+!![])+(+[])+(+(+!![]+(!![]+[])[!![]+!![]+!![]]+(+!![])+(+[])+(+[]))+[])[!![]+!![]]+(![]+[])[+[]]+![]+(!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+[])[+[]]+![]+(!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![])+(![]+[])[+!![]]+![]+(!![]+!![])+(!![]+!![])+![]+(!![]+!![])+(!![]+!![]))[(![]+[])[!![]+!![]+!![]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]]+[])[!![]+!![]+[+[]]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[+!![]])()([][[]]))[+!![]+[+[]]]+(![]+[])[!![]+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[+[]]](![])[([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([![]]+[][[]])[+!![]+[+[]]]+([][[]]+[])[+!![]]]([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]]+[])[!![]+!![]+[+[]]]+(![]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]])()(+[]+[+[]]+(+[])+(![]+[])[!![]+!![]])[!![]+!![]])))

From

[].filter.constructor(unescape('returnfalse20ffalse3dfalse28tfalse3d10false29false3dfalse3etfalse2d36false3ftfalse2etfalse6ffalse53trinfalse67false2836false29false2erefalse70eatfalse28++tfalse2d10false29+false60false0afalse60+ffalse28tfalse29false3afalse22false22'.split(false).join('%')))

Both work on Firefox, because I only have it

l4m2

Posted 2017-11-08T22:09:32.820

Reputation: 5 985

0

SNOBOL4 (CSNOBOL4), 74 bytes

O	&LCASE POS(I) LEN(1) . X
	I =I + 1
	OUTPUT =LE(I,26) DUPL(X,I) :S(O)
END

Try it online!

O	&LCASE POS(I) LEN(1) . X		;* set X to I'th 0-indexed character of lowercase letters
	I =I + 1				;* increment I
	OUTPUT =LE(I,26) DUPL(X,I) :S(O)	;* if I<=26, output X DUPLicated I times and goto O otherwise goto END
END

Giuseppe

Posted 2017-11-08T22:09:32.820

Reputation: 21 077

0

uBASIC, 57 bytes

Anonymous function that takes no input and outputs to the console.

0ForI=1To26:ForJ=1ToI:?Left$(Chr$(I+64),1);:NextJ:?:NextI

Try it online!

Taylor Scott

Posted 2017-11-08T22:09:32.820

Reputation: 6 709

0

MY-BASIC, 59 bytes

Anonymous Function that takes no input and outputs to the console.

For I=1 To 26
For J=1 To I
Print Chr(I+64)
Next
Print;
Next

Try it online!

Taylor Scott

Posted 2017-11-08T22:09:32.820

Reputation: 6 709

0

Yabasic, 49 bytes

A BASIC answer that takes no input and outputs to the console.

For I=1To 26
For J=1To I
?Chr$(I+64);
Next
?
Next

Try it online!

Taylor Scott

Posted 2017-11-08T22:09:32.820

Reputation: 6 709

0

Visual Basic .NET (Mono), 120 bytes

Another BASIC answer

Module M
Sub Main
Dim S,I,J
For I=1To 26
S=""
For J=1To I
S+=Chr(I+64)
Next
Console.WriteLine(S)
Next
End Sub
End Module

Try it online!

Taylor Scott

Posted 2017-11-08T22:09:32.820

Reputation: 6 709

0

Pepe, 49 bytes

rEeEEeeeeEREeEEEEeEEREEreeereeErEEEeErEEEEEeeERee

Try it online!

Explanation:

rEeEEeeeeE # Push A (r)
REeEEEEeEE # Push 91 (Z + 1) (R)
REE        # Start loop labeled 91
           # | All the following commands below operate on r
reee       # | Output whole stack of r
reeE       # | Output newline "\n"
rEEEeE     # | Duplicate char to end
rEEEEEeeE  # | Increment whole stack
Ree        # If r != 91, repeat loop

u_ndefined

Posted 2017-11-08T22:09:32.820

Reputation: 1 253

0

sed, 82 bytes

s:^:a:
:A
p
y:abcdefghijklmnopqrstuvwxy:bcdefghijklmnopqrstuvwxyz:
s:.:&&:
/z/q
bA

Try it online!

Loop from a to z. The last line is printed implicitly, preceding lines are printed with a p.

eush77

Posted 2017-11-08T22:09:32.820

Reputation: 1 280

0

MBASIC, 42 bytes

1 FOR I=1 TO 26:PRINT STRING$(I,96+I):NEXT

wooshinyobject

Posted 2017-11-08T22:09:32.820

Reputation: 171

0

Whitespace, 127 bytes

Because the syntax is entirely in whitespace characters, each character is prefixed with S, T, or L (for Space, Tab, and Linefeed, respectively).

S S S T	L
L
S S L
S L
S S L
S S S S T	T	S S S S S L
T	S S S L
S S T	L
S L
S T	L
S S S L
T	S S S T	L
T	S S T	S L
S L
T	S T	S L
S L
T	L
S L
T	L
L
S S T	S L
S L
L
S L
L
S S S T	S T	S L
T	L
S S S S S T	L
T	S S S S L
S S S S T	T	S T	T	L
T	S S T	L
T	T	L
L
L
L

Try the whitespace-only version online!

JosiahRyanW

Posted 2017-11-08T22:09:32.820

Reputation: 2 600

0

Julia, 42 36 bytes

[println(l^(l-'`')) for l∈'a':'z']

EricShermanCS

Posted 2017-11-08T22:09:32.820

Reputation: 121

0

K4, 13 bytes

(1+!26)#'.Q.a

Output:

q)k)(1+!26)#'.Q.a
,"a"
"bb"
"ccc"
"dddd"
"eeeee"
"ffffff"
"ggggggg"
"hhhhhhhh"
"iiiiiiiii"
"jjjjjjjjjj"
"kkkkkkkkkkk"
"llllllllllll"
"mmmmmmmmmmmmm"
"nnnnnnnnnnnnnn"
"ooooooooooooooo"
"pppppppppppppppp"
"qqqqqqqqqqqqqqqqq"
"rrrrrrrrrrrrrrrrrr"
"sssssssssssssssssss"
"tttttttttttttttttttt"
"uuuuuuuuuuuuuuuuuuuuu"
"vvvvvvvvvvvvvvvvvvvvvv"
"wwwwwwwwwwwwwwwwwwwwwww"
"xxxxxxxxxxxxxxxxxxxxxxxx"
"yyyyyyyyyyyyyyyyyyyyyyyyy"
"zzzzzzzzzzzzzzzzzzzzzzzzzz"

Thaufeki

Posted 2017-11-08T22:09:32.820

Reputation: 421

0

Scala (39 bytes)

('a'to'z')map(n=>println(s"$n"*(n-96)))

Try it online

jrook

Posted 2017-11-08T22:09:32.820

Reputation: 211

0

Dart, 81 bytes

List.generate(26,(i)=>''.padRight(i+1,String.fromCharCode(i+97))).forEach(print);

Try it online!

Elcan

Posted 2017-11-08T22:09:32.820

Reputation: 913

0

Ahead, 28 bytes

Featuring trailing newline!

'a'zEr~@~kdW<
~:\N\0<~'a-k:l

Try it online!

snail_

Posted 2017-11-08T22:09:32.820

Reputation: 1 982