Make the Mexican Wave
Pyth, 12 bytes
V+Gt_GXGNrN1
Demonstration.
In Pyth, G
is the lowercase alphabet. +Gt_G
is abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba
, the character that needs to be uppercased in each row.
V
sets up a for loop over this string, with N
as the loop variable.
In the body, XGNrN1
is a string translation function. X
translates G
, the alphabet, replacing N
with rN1
, the uppercase version of N
. r ... 1
is the uppercase function. This gives the desired output.
C,73
Sometimes the simplest approach is best: print every character one by one. this beats a lot of languages it really shouldn't.
i;f(){for(i=1377;i--;)putchar(i%27?123-i%27-32*!(i/702?i%28-4:i%26):10);}
explanation
i;f(){
for(i=1377;i--;)
putchar(i%27? //if I not divisible by 27
123-i%27- // print lowercase letter from ASCII 122 downards
32*!(i/702?i%28-4:i%26) // subtract 32 to make it uppercase where necessary: above i=702, use i%28-4, below it use i%26
:10); //if I divisible by 27 print a newline (10)
}
Python 2, 69 bytes
i=25
exec"L=range(97,123);L[~abs(i)]^=32;i-=1;print bytearray(L);"*51
Nice and simple, I think.