Generate a "Poem"

Pyth, 9 bytes

V>QG+N<Gt

Try it online!

  • V>QG For each letter in the last Q (the input) elements of the lowercase alphabet:

  • +N>Gt Append that letter to the first Q-1 elements of the lowercase alphabet

For Q=13, the output looks like this:

nabcdefghijkl
oabcdefghijkl
pabcdefghijkl
qabcdefghijkl
rabcdefghijkl
sabcdefghijkl
tabcdefghijkl
uabcdefghijkl
vabcdefghijkl
wabcdefghijkl
xabcdefghijkl
yabcdefghijkl
zabcdefghijkl

Charcoal, 11 bytes

NθUOθ⮌β↓…βθ

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

Nθ

Input N.

UOθ⮌β

Print a square of size N filled with the reversed lowercase alphabet.

↓…βθ

Print the first N lowercase letters downwards.


C (gcc), 58 bytes

i,j;f(n){for(i=n;i;)putchar(j++?j>n?j=!i--,10:j+63:i+77);}

Try it online!