A magic square of order n is a square in which all n2 integers are distinct, greater than 0 and are chosen in such a way, that the n numbers in each row, column and diagonal of the square add up to the same constant.

Assignment: assignment.pdf
Solution sourcecode: MagicSquares.java
Discussion: Click here to post/read comments on this assignment

Techniques used:

  • two dimensional arrays
  • recursion

Application type: Command line