-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (27 loc) · 783 Bytes
/
main.cpp
File metadata and controls
32 lines (27 loc) · 783 Bytes
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
// Thibault Joseph Twahirwa
// Lab 4, cse20312
//
// main driver
// generate board fromfile input and solve
#include <iostream>
#include "Puzzle.h"
#include <fstream>
#include <cstdlib>
using namespace std;
int main()
{
// read in a filename from the user. Do not run the program if the file does not exist
ifstream inFile; // object for reading from a file
string puzName;
cout << "\nPlease enter the full file name of the textfile containing the sudoku puzzle.\nFilename: ";
cin >> puzName;
inFile.open(puzName.c_str(), ios::in); // opens the puzzlefile for input
if(! inFile) {
cout << "Error File does not exist."<< endl;
return 1;
}
inFile.close();
Puzzle sudoku( puzName );
sudoku.solve();
return 0;
}