-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
50 lines (38 loc) · 1.06 KB
/
main.cpp
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
44
45
46
47
48
49
#include <stdexcept>
#include <iostream>
#include <fstream>
#include <chrono>
#include "tagboard.h"
#include "findertaggame.h"
using namespace std;
int main()
{
try
{
ifstream fin("input.txt");
if(!fin.is_open())
{
cout << "File not open!";
return 3;
}
TagBoard tag;
fin >> tag;
auto beginTime = std::chrono::high_resolution_clock::now();
FinderTagGame finder(tag);
FinderTagGame::TagMoveList moves = finder.getMoveList();
auto endTime = std::chrono::high_resolution_clock::now();
std::chrono::duration<double, std::milli> elapsedTime = endTime - beginTime;
for(FinderTagGame::TagMoveList::iterator it = moves.begin();
it != moves.end(); it++)
{
cout << *it <<endl;
}
cout << "Moves count: " << moves.size() <<endl;
cout << "elapsed time: " << elapsedTime.count() << "ms" << std::endl;
}
catch (const std::logic_error& e)
{
cout << e.what();
}
return 0;
}