Write a square block of code that is N characters wide and N characters tall, for some positive integer N.
For instance, your N may be 5 and the block look like this:
ThisI
sMy5B
y5Cod
eBloc
kOkay
This block needs to behave as follows:
When the top row is extracted and run as a program, the exact text
row
needs to be printed to stdout.For example,
ThisI
would printrow
.When the left column is extracted and run as a program, the exact text
col
needs to be printed to stdout.For example,
Tsyek
would printcol
.When the main diagonal from the top left to the bottom right corners is extracted and run as a program, the exact text
dia
needs to be printed to stdout.For example,
TMCoy
would printdia
.When the entire block is run as a program, including the newlines (with an optional trailing newline), the exact text
blk
needs to be printed to stdout.For example,
ThisI sMy5B y5Cod eBloc kOkay
would print
blk
.
Details
- All four programs are run in the same programming language.
- The N2 characters in the original block may be anything but line terminators.
- If your language does not have an stdout, you may use another common output method. It must be the same method across all four programs.
The submission whose original block contains the fewest distinct characters (not counting newlines) wins. Tiebreaker goes to the submission with the smaller N.