Lo Shu Magic Program Help

Hello, I am in need of assistance in creating this type of program. I tried what I know so far in regards to it, but for some reason I can't seem to finish it properly and I only have a start. According to what the program asks, it says "White a program that accepts the 9 numbers in the 3x3 grid from the user and passes those to a function using a 2-dimenstional array. The function will check whether it fits the description of a Lo Shu Magic square and return true if it does, false otherwise. The program should inform the user of the results and ask the user whether he wishes to continue with another square. I tried my best in regards to this, and I greatly appreciate any help.

This is what I am trying to make the output look like:

Please enter your solution to the Lo Shu Magic Square:

Row 1: 1 9 3
Row 2: 5 8 4
Row 3: 2 6 7

Sorry, this is not a Lo Shu Magic Square.

Continue (y/n)? y

Row 1:



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>

using namespace std;

#define SUM(a) (array[a[0]/3][a[0]%3] + array[a[1]%3] + array[a[2]/3][a[2]%3]);

int LoShuMagic(int array[3][3])
{
	static const int t[8][3] = {{0,1,2},{3,4,5},{6,7,8},{0,3,6},{1,4,7},{2,5,8},{0,4,8},{2,4,6}};

	int sum = SUM(t[0]);
	int same = 1;
	for (int i = 1; i < 9; i++);
	{
		same = same && sum == SUM(t[i]);
	}

	system("pause");
	return same;
}
Sorry for the bump.
Topic archived. No new replies allowed.