* MORE CONSTRAINTS TO BE ADDED ON.
must use command line arguments. At the command line the user must enter (in this order):
* * the name of the executable file,
* the value of n,
* and the name of the output file in which to write the squares.
* You will present the user with a menu that asks him to choose between writing to a file, displaying to the screen or quitting. This menu must accept characters for the user's response and they may be either the upper or lower case versions of those letters. The choices must be:
* * D (or d) to display to the screen,
* W (or w) to write to the file, or
* Q (or q) to quit.
* You must use a **recursive permute** to give all of the permutations of the square. In other words, your function called Permute, must be a recursive function.
**DO NOT TRY TO STORE ALL OF THE POSSIBLE SQUARES IN MEMORY, SINCE YOU WON'T HAVE NEARLY ENOUGH MEMORY TO DO SO.** So for each permutation, you should check to see if it is a magic square and if it is either display it or write it to the file (whichever the user has chosen).
* Your program must write only the unique magic squares. No duplicates allowed. HINT: Let your program produce duplicates first, then see how you can easily refrain from writing the duplicates. Then modify your code.
* **The code for the recursive permute function will be much easier to write if you store the numbers in a one-dimensional array of size n2, rather than a two-dimensional array of size n x n.** You can always print it out however you like.
* You MUST close any files that you have opened and also free any memory that you have dynamically allocated as soon as you have finished using them.
* You must use separate compilation for this project.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
Needs to be done In C on a gcc compiler
* You must time your program when it is run with n = 3 and calculate an estimate of what the running time would be by the same program on the same system for an n of 4 and also for an n of 5. You should base your answers on the premise that almost all of your program's running time is taken up by generating the permutations. You will actually prove this premise by examining the running time for n of 1 and n of 3. Do not leave your answer in seconds, but express it the largest time units possible. Here's a bogus example: 5 weeks, 3days, 17 hours, 22 minutes and 16 seconds. You may use the generalities that a month consists of 30 days and a year consists of 365 days, if you need to go that far with your time units. You must submit the time information in a file called [login to view URL], which is due at the same time as your project.