8
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 usei++;i++;... i++;
instead ofi+=10;
, but you shouldn't define a variablestring 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 code-bowling, the program with the largest N and the highest complexity will win.
6What's the type of this challenge (e.g. code golf, popularity contest)? – Jakob – 2017-08-20T05:52:13.393
@Jakob Is a popularity contest still allowed? – iBug – 2017-08-20T06:29:21.673
I'd suggest adding the [tag:restricted-source] tag. – darrylyeo – 2017-08-20T06:30:30.637
1@iBug pop-contests are allowed but they rarely get well-received... :D – officialaimm – 2017-08-20T06:36:58.030
4I 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. – Post Rock Garf Hunter – 2017-08-20T07:10:20.830
3You should also define what is meant by a comment. This is not a defined term on its own. – Post Rock Garf Hunter – 2017-08-20T07:11:28.280
Rule of thumb: if a program whose text is
1
and which outputs1
is a valid answer then the question is badly flawed. Putting in a special rule to disallow that program isn't a proper fix. – Peter Taylor – 2017-08-20T07:18:49.5131@PeterTaylor "N must be at least two.",
1
is a 1 by 1 square meaning it is too small. – Post Rock Garf Hunter – 2017-08-20T07:22:34.0571@iBug. Can we output a new line before the square? – None – 2017-08-20T08:15:41.127
4
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.
– m-chrzan – 2017-08-20T16:24:26.113@WheatWizard well that's the special rule isn't it – ASCII-only – 2017-08-21T00:03:45.477
You might look into [tag:code-bowling] – Stephen – 2017-08-21T01:16:57.240
code-golf doesn't make sense, since every valid entry will have N*(N+1) characters, and I don't think you mean for smaller programs to be "better" than larger programs. – aschepler – 2017-08-21T02:37:05.587
Can the source code be a rectangle like in the
N = 6
JavaScript answer or must it be square? – TheLethalCoder – 2017-08-21T08:45:37.187Does the last output line need to end in a linefeed? – L3viathan – 2017-08-21T12:27:56.517
There is no actual winning criterion stated in your question. – Okx – 2017-08-21T13:29:18.167
@Okx Oops! Someone edited it out! – iBug – 2017-08-21T14:33:45.720
5@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. – m-chrzan – 2017-08-21T16:43:23.143
Example of arbitrarily large Ruby squares. – m-chrzan – 2017-08-21T16:44:12.290
Bonus: make it a quine ;) – Graviton – 2017-08-21T22:17:07.477
@iBug is complexity actually a factor in scoring? Also what should be done if arbitrarily large programs can be made? – dylnan – 2018-03-01T00:27:12.290
3Seems it's better a code-golf and it's really treated as a code-golf somehow – l4m2 – 2018-05-05T00:09:46.113
1Voting to close. The question should be changed to [code-golf] because otherwise the weak source restriction makes it too easy, and code can be bowled arbitrarily large. – mbomb007 – 2019-05-08T15:15:24.853