The kata's testing code incorrectly assumes that there is only 1 possible row/column/diagonal sum for every magic square of a certain size. In fact this is already untrue for 4x4 magic squares.
Its calculation is also flawed: adding a constant to all numbers will result in the "expected sum" to change by a different amount. Any minimum value other than 0 will cause the sum test to fail.
The kata's testing code incorrectly assumes that there is only 1 possible row/column/diagonal sum for every magic square of a certain size. In fact this is already untrue for
4x4
magic squares.Its calculation is also flawed: adding a constant to all numbers will result in the "expected sum" to change by a different amount. Any minimum value other than
0
will cause the sum test to fail.This kata cannot be solved:
Seems like it does not work... at least.. for valid 3x3 square i got response:
The sum in row 0 is incorrect.: expected 15 to equal 13.5
This comment is hidden because it contains spoiler information about the solution