MagicSquare, initial version, pseudocode