A magic square solver written in Scala