9
\$\begingroup\$

Squares looks symmetric, and so are the required codes.

Objective: Write a program whose source code is a solid square (N lines with N printable, non-whitespace characters each line) and prints a square of equal size. A program (or output) with inconsistent width and height is invalid. (e.g. 6x5)

Example (HQ9+)

QAA
AAA
AAA

Requirements

  • Both the source and the output must contain N lines, and N printable characters each line, followed by 1 linefeed. Your program should not contain or output any control characters (except LF or CR-LF) or whitespaces (Space, Tab, VTab)
  • Standard loopholes are boring, don't use them.
  • A program (and output) with only one character is fundamentally nothing. N must be at least two.
  • The content of the output doesn't matter, as long as it complies with rule 1
  • Special rule: Do not use comments or codes that does not affect the output to "fill" your code.
    To be clear, you are allowed to use i++;i++;... i++; instead of i+=10;, but you shouldn't define a variable string s="placeholder" but never use it later. It is very easy to work around this rule so don't be too strict.
  • If you want to output a newline before everything else, it OK but please declare that you're using this rule.
    If you want to output the last line without a succeeding linefeed, it's OK, too and you don't need to declare it. However that does not affect scoring.

Additional: Please give the number N (width/height) your program is using. Provide descriptions of your code if possible.

There is no need to give the length (in bytes) of your program because the N says it all.

Because this is a , the program with the largest N and the highest complexity will win.

\$\endgroup\$
23
  • 6
    \$\begingroup\$ What's the type of this challenge (e.g. code golf, popularity contest)? \$\endgroup\$
    – Jakob
    Aug 20, 2017 at 5:52
  • 4
    \$\begingroup\$ I don't think this is up to our standards of popularity contests. Simply slapping the tag on a question is not sufficient. Please read the tag wiki for a more detailed guide. \$\endgroup\$
    – Wheat Wizard
    Aug 20, 2017 at 7:10
  • 3
    \$\begingroup\$ You should also define what is meant by a comment. This is not a defined term on its own. \$\endgroup\$
    – Wheat Wizard
    Aug 20, 2017 at 7:11
  • 4
    \$\begingroup\$ We've had similar challenges before. I'd suggest making this code-golf, maybe adding restricted-source or quine tags, and maybe dropping the no comments requirement as it's somewhat unclear. Wouldn't see any reasons to not reopen then. \$\endgroup\$
    – m-chrzan
    Aug 20, 2017 at 16:24
  • 5
    \$\begingroup\$ @iBug this had the code-golf tag for a good 7 hours before being changed to the exact opposite - code-bowl. Most answers are trying to find the minimal square that outputs a square. Also, with the given limitations, it is very easy to create arbitrarily large squares in most languages. Adding limitations would once again be unfair to current answers. \$\endgroup\$
    – m-chrzan
    Aug 21, 2017 at 16:43

32 Answers 32

1
2
0
\$\begingroup\$

05AB1E, N=∞ (\$\geq7\$), ∞ (\$\geq55\$) bytes

"AAAAAA
AAAAAAA
AAAAAAA
AAAAAAA
AAAAAAA
AAAAAAA
"¬ì¬7׫

Try it online or try it with a larger example or verify that the output is a square.

Explanation:

The amount of A on every line can be increased, and an equal amount of additional lines of As are added as well. Also, the A can be any character of your own choice.

"AAAAAA
AAAAAAA
AAAAAAA
AAAAAAA
AAAAAAA
AAAAAAA
"        # Push this string
 ¬       # Get the first character of this string (without popping)
  ì      # Prepend this character to the string
   ¬     # Get the first character again (without popping)
    7×   # Repeat it 7 times
      «  # And append it to the string (which is output implicitly as result)

05AB1E, N=2, 5 bytes

0º
∊?

Try it online.

Explanation:

0     # Push 0
 º    # Mirror it horizontally: "00"
  ∊   # Mirror it vertically: "00\n00"
   ?  # Print it without trailing newline
\$\endgroup\$
0
\$\begingroup\$

Python 3, N=200, 40199 bytes

print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))
print("##################################################"*"#######################################################################################################".count("#########################"))

Try it online!

You can theoretically extend this indefinitely. Based on Mr. Xcoder's method of repeating print statements.

\$\endgroup\$
1
2

Not the answer you're looking for? Browse other questions tagged or ask your own question.