A magic square is an \$ n \times n \$ square grid, such that the sum of the integers on each row and column are equal. Note that the definition which will be used in this challenge is different than the one used by Wikipedia, since
- diagonal sums are not accounted for
- the numbers are not required to be distinct or in the range \$ 1, 2, ..., n^2 \$
Task
Write a program/function such that given an \$ n \times n \$ square, return Truthy if it is a magic square, and Falsey otherwise. There is a catch, however. The source code itself must also form a magic square, where each character in the source code corresponds to its Unicode codepoint.
Rules/Clarifications
- You may take input in any reasonable format (e.g. 2D array, flattened list, etc.)
- The source code should be a list of \$ n \$ strings, each consisting of \$ n \$ characters, joined by newlines.
- The unicode character should be in its composed representation.
- Here is a program to check if your program/function is a magic square
This is code-golf, so the shortest code in bytes wins!
À
, is that codepointU+00C0
(LATIN CAPITAL LETTER A WITH GRAVE) or codepointsU+0041 U+0300
(LATIN CAPITAL LETTER A COMBINING GRAVE ACCENT)? \$\endgroup\$😐́
(NEUTRAL FACE COMBINING ACUTE ACCENT) line up? It's one grapheme, 2 Unicode characters, and multiple bytes (how many will depend on the encoding (UTF-8, UTF-16, something else)). How many columns in your program does it take? \$\endgroup\$