0

I am working on a nxn magic square that I just cn't seem to figure out. Basically I have a data file that is .txt and has meta data.

3
Matrix One
5 7
45   38    5   56   18   34    4
87   56   23   41   75   87   97
45   97   86    7    6    8   85
67    6   79   65   41   37    4
 7   76   57   68    8   78    2
Matrix Two
6 8
45   38    5   56   18   34    4   30
87   56   23   41   75   87   97   49
45   97   86    7    6    8   85   77
67    6   79   65   41   37    4   53
 7   76   57   68    8   78    2   14
21   18   46   99   17    3   11   73
Matrix Three
6 6
45   38    5   56   18   34
87   56   23   41   75   87
45   97   86    7    6    8
67    6   79   65   41   37
 7   76   57   68    8   78
21   18   46   99   17    3

I have to read this into my program using an array, then create a report that will display these results in the console application. I have used StreamReader and Writer to create the text file and read in from the text file. But I'm stuck after that. I honestly just don't know what to do after that point. I'm not against using Linq, or classes to acheive the solution. The report will show each square above.

2
Contributors
1
Reply
8
Views
1 Year
Discussion Span
Last Post by darkagn
0

Once you have read the file into memory, you should be able to write each line out to the console. If you search for the Console.WriteLine function in your favourite search engine you will find plenty of examples.

Good luck!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.