Java 1.8, 96 bytes
I managed to flatten everything into one for-loop with a single print statement.
void f(){for(int i=-1,j=0,k=i;++i<702;k=(i+1)%27)System.out.write(k>25?++j-j+10:65+(k>j?k:j));}
Or ungolf'ed:
interface C {
static void main(String[] a) {
f();
}
static void f() {
for (int i = -1, j = 0, k = i; ++i < 702; k = (i + 1) % 27) {
System.out.write(k > 25 ? ++j - j + 10 : 65 + (k > j ? k : j));
}
}
}
Approach is based on my Tabula Recta answer. This leverages the fact that the System.out
stream is line-buffered, causing an auto-flush whenever a line feed character (10
) is written.
I have a feeling this can be golf'ed down further, mainly because of the way the values of certain variable are juggled with (i.e. j
).