-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
43 lines (35 loc) · 910 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include<stdio.h>
#include"SuDoKu.h"
int main()
{
FILE* inputFile;
FILE* outputFile;
char* inputFileName = "Input.txt";
char* outputfileName = "Output.txt";
printf("Reading input file \n");
if((inputFile = fopen(inputFileName, "r"))== NULL)
{
printf("File could not be opened %s \n", inputFileName);
perror("Error :");
return 1;
}
AddInitialValues(inputFile);
fclose(inputFile);
printf("Su Do Ku Puzzle \n");
PrintBoard(stdout);
printf("Solving Puzzle ...\n");
Solve();
printf("Solved Puzzle \n");
PrintBoard(stdout);
printf("Printing to output file \n");
if((outputFile = fopen(outputfileName, "w"))== NULL)
{
printf("File could not be opened %s \n", inputFileName);
perror("Error :");
return 1;
}
PrintBoard(outputFile);
fclose(outputFile);
printf("Closing game \n");
return 0;
}