[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

Formula to fill any magic square.

Asked by Mateen in Puzzles & Riddles

Tags: magic, square, formula

I don't know how and when I happened to find a technique to fill
any odd square (with odd number of lines 5x5 or 7x7 or 9x9 etc)
with numbers from 1 to number of squares so that
sum of each row
and
sum of each column
and
sum of both diagonal is always the same.

I also don't know whether it is already discussed in  EE Puzzle area.


The method is to identify the next square to write numbers sequentially starting with 1.
Starting point can self be understood.


For example let's consider a 5x5 square

** ** ** ** **
xx xx xx xx **
xx xx xx xx **
xx xx xx xx **
xx xx xx xx **


The squares marked by ** may be called KeySquares
KeySquares at top of the row may be called KeyRowSqr
KeySquares at the last column may be called KeyColSqr

Rules
a) When square is not key square always move diagonally up.
b) When square is not key square and there is no room to move diagonally up shift one square left.
c) When square is KeyColSqr move horizontally left to reach first column and move one square up.
   this will form an L (Reverse)
d) When square is KeyRowSqr move vertically down to reach last row and move one square right.                
   this will form an L (proper)


1 Starting Point
---------------
** ** ** ** **
xx xx xx xx **
xx xx xx xx  1
xx xx xx xx **
xx xx xx xx **

2 RULE C      
--------------
** ** ** ** **
 2 xx xx xx **
xx xx xx xx  1
xx xx xx xx **
xx xx xx xx **

3 RULE A
---------------
**  3 ** ** **
 2 xx xx xx **
xx xx xx xx  1
xx xx xx xx **
xx xx xx xx **

4 RULE D
--------------
**  3 ** ** **
 2 xx xx xx **
xx xx xx xx  1
xx xx xx xx **
xx xx  4 xx **

5 RULE A
--------------
**  3 ** ** **
 2 xx xx xx **
xx xx xx xx  1
xx xx xx  5 **
xx xx  4 xx **


6 RULE B
--------------
**  3 ** ** **
 2 xx xx xx **
xx xx xx xx  1
xx xx  6  5 **
xx xx  4 xx **


7,8 RULE A
--------------
**  3 ** ** **
 2 xx xx xx  8
xx xx xx  7  1
xx xx  6  5 **
xx xx  4 xx **


9 RULE C
--------------
 9  3 ** ** **
 2 xx xx xx  8
xx xx xx  7  1
xx xx  6  5 **
xx xx  4 xx **

10 RULE D
--------------
 9  3 ** ** **
 2 xx xx xx  8
xx xx xx  7  1
xx xx  6  5 **
xx 10  4 xx **

11 RULE B
--------------
 9  3 ** ** **
 2 xx xx xx  8
xx xx xx  7  1
xx xx  6  5 **
11 10  4 xx **


12,13,14,15 RULE A
------------------
 9  3 ** ** 15
 2 xx xx 14  8
xx xx 13  7  1
xx 12  6  5 **
11 10  4 xx **


16 RULE B
---------------
 9  3 ** 16 15
 2 xx xx 14  8
xx xx 13  7  1
xx 12  6  5 **
11 10  4 xx **

17 RULE D
--------------
 9  3 ** 16 15
 2 xx xx 14  8
xx xx 13  7  1
xx 12  6  5 **
11 10  4 xx 17


18 RULE C
--------------
 9  3 ** 16 15
 2 xx xx 14  8
xx xx 13  7  1
18 12  6  5 **
11 10  4 xx 17


19,20 RULE A
--------------
 9  3 ** 16 15
 2 xx 20 14  8
xx 19 13  7  1
18 12  6  5 **
11 10  4 xx 17

21 RULE B
--------------
 9  3 ** 16 15
 2 21 20 14  8
xx 19 13  7  1
18 12  6  5 **
11 10  4 xx 17

22 RULE A
--------------
 9  3 22 16 15
 2 21 20 14  8
xx 19 13  7  1
18 12  6  5 **
11 10  4 xx 17

23 RULE D
--------------
 9  3 22 16 15
 2 21 20 14  8
xx 19 13  7  1
18 12  6  5 **
11 10  4 23 17

24 RULE A
--------------
 9  3 22 16 15
 2 21 20 14  8
xx 19 13  7  1
18 12  6  5 24
11 10  4 23 17

25 RULE C
--------------
 9  3 22 16 15
 2 21 20 14  8
25 19 13  7  1
18 12  6  5 24
11 10  4 23 17



My Question:
Since there is concrete rules it can be coded / programmed in any computer language.
Can some one code these rules.
Although sql server is preferred, u may code in any known language.
I can always put those code to SQL Server area of EE and can have equivalent.







[+][-]06/28/05 11:32 PM, ID: 14325716Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Puzzles & Riddles
Tags: magic, square, formula
Sign Up Now!
Solution Provided By: ozo
Participating Experts: 2
Solution Grade: A
 
[+][-]06/28/05 11:00 PM, ID: 14325614Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/29/05 12:07 AM, ID: 14325832Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/29/05 12:56 AM, ID: 14326000Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/29/05 02:10 AM, ID: 14326632Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06/29/05 03:46 AM, ID: 14327175Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06/29/05 04:17 AM, ID: 14327328Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/29/05 11:32 PM, ID: 14335832Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92