Skip to main content
Became Hot Network Question
added 85 characters in body
Source Link
anatolyg
  • 13.9k
  • 2
  • 39
  • 110

A Latin square of order n is text which is arranged as a square of n lines by n columns, contains n different characters, and each character appears once in each line and column. For example, here is a Latin square of order 9:

Code gOlf
ode gOlfC
de gOlfCo
e gOlfCod
 gOlfCode
gOlfCode 
OlfCode g
lfCode gO
fCode gOl

Make a program which outputs a Latin square of order n (like in this other challenge), but the program must also be a Latin square of order n. The output must be different (i.e. not a quine) - use different symbols and/or in different order.

Some notes on formatting:

  1. Output to stdout or return a string which could be printed to stdout directly (i.e. it should contain newline bytes).
  2. Leading and trailing spaces are allowed only if the square doesn't otherwise contain spaces.
  3. Leading and trailing newlines are allowed.
  4. Tab and other control characters are allowed only if your system can print them without disturbing the square shape.
  5. Usual Code Golf - your score is the number of bytes in your program, so a score should normally be n²+n-1 or n²+n.
  6. Include your program's output in your answer, if you think it looks pretty.

As noted by tsh, n = 1 is uninteresting, so let's add a restriction n > 1.

A Latin square of order n is text which is arranged as a square of n lines by n columns, contains n different characters, and each character appears once in each line and column. For example, here is a Latin square of order 9:

Code gOlf
ode gOlfC
de gOlfCo
e gOlfCod
 gOlfCode
gOlfCode 
OlfCode g
lfCode gO
fCode gOl

Make a program which outputs a Latin square of order n (like in this other challenge), but the program must also be a Latin square of order n. The output must be different (i.e. not a quine) - use different symbols and/or in different order.

Some notes on formatting:

  1. Output to stdout or return a string which could be printed to stdout directly (i.e. it should contain newline bytes).
  2. Leading and trailing spaces are allowed only if the square doesn't otherwise contain spaces.
  3. Leading and trailing newlines are allowed.
  4. Tab and other control characters are allowed only if your system can print them without disturbing the square shape.
  5. Usual Code Golf - your score is the number of bytes in your program, so a score should normally be n²+n-1 or n²+n.
  6. Include your program's output in your answer, if you think it looks pretty.

A Latin square of order n is text which is arranged as a square of n lines by n columns, contains n different characters, and each character appears once in each line and column. For example, here is a Latin square of order 9:

Code gOlf
ode gOlfC
de gOlfCo
e gOlfCod
 gOlfCode
gOlfCode 
OlfCode g
lfCode gO
fCode gOl

Make a program which outputs a Latin square of order n (like in this other challenge), but the program must also be a Latin square of order n. The output must be different (i.e. not a quine) - use different symbols and/or in different order.

Some notes on formatting:

  1. Output to stdout or return a string which could be printed to stdout directly (i.e. it should contain newline bytes).
  2. Leading and trailing spaces are allowed only if the square doesn't otherwise contain spaces.
  3. Leading and trailing newlines are allowed.
  4. Tab and other control characters are allowed only if your system can print them without disturbing the square shape.
  5. Usual Code Golf - your score is the number of bytes in your program, so a score should normally be n²+n-1 or n²+n.
  6. Include your program's output in your answer, if you think it looks pretty.

As noted by tsh, n = 1 is uninteresting, so let's add a restriction n > 1.

Source Link
anatolyg
  • 13.9k
  • 2
  • 39
  • 110

Output a Latin square with a program which is a Latin square

A Latin square of order n is text which is arranged as a square of n lines by n columns, contains n different characters, and each character appears once in each line and column. For example, here is a Latin square of order 9:

Code gOlf
ode gOlfC
de gOlfCo
e gOlfCod
 gOlfCode
gOlfCode 
OlfCode g
lfCode gO
fCode gOl

Make a program which outputs a Latin square of order n (like in this other challenge), but the program must also be a Latin square of order n. The output must be different (i.e. not a quine) - use different symbols and/or in different order.

Some notes on formatting:

  1. Output to stdout or return a string which could be printed to stdout directly (i.e. it should contain newline bytes).
  2. Leading and trailing spaces are allowed only if the square doesn't otherwise contain spaces.
  3. Leading and trailing newlines are allowed.
  4. Tab and other control characters are allowed only if your system can print them without disturbing the square shape.
  5. Usual Code Golf - your score is the number of bytes in your program, so a score should normally be n²+n-1 or n²+n.
  6. Include your program's output in your answer, if you think it looks pretty.