Hi,

would it "conceptually" fit to add a function (somwhere) into Sympy
that can generate magic squares ?

I was going through some examples online (I think it was Matlab
actually) where a "magic square" was often used just as a convenient
way to get a matrix filled with some "interesting" values.

The code is already written (MIT License) and available:
http://pypi.python.org/pypi/magic_square
and/or
http://mihailovs.com/Alec/Python/magic_square.html

magic_square.py is supposedly also included in sage, but I thought it
could be copied to Sympy since its simple enough and maybe of interest
to others also.

The module is about 300 lines of code and includes long doc strings
and many doc-tests (only not formated correctly, as far as I can tell)
I would recommend to do some code changes later on.
The package is dated  2007-02-23  and some parts seem to not conform
to "good style", e.g

>>> magic_square.ismagic(None)
NotImplemented
----> there is lots of special code related to "None" handling, and
some questionable use global variables

>>> magic_square.magic(2)
TypeError: No such magic squares exist.
----> should be ValueError -- or ?


Regards,

Sebastian Haase

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com
To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to