this is my first post, so pls be polite ;)
since a few days i am programming java (for school).
but i dont get it.. i tried to fill the 4x4 matrix with random generated numbers (1-16) and wrote a method, that they could only be used once.
then i wrote some methods to check wether die rows,cols and diagonals have the right sum.
But that way coasts me ~1 day to find a real magic square and that is def. not okay.
i googled for a while and found many solutions, but most of them didn't work correctly. someone told me, that i am supposed to use "backtracking". but i dont understand this theory.
Does anybody have a working backtracking solution for an evan magic square or could explain that theory to me?
it would be really great!
ps: sorry for my bad english.