-
Notifications
You must be signed in to change notification settings - Fork 0
/
Load.h
57 lines (57 loc) · 1.27 KB
/
Load.h
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
50
51
52
53
54
55
56
57
#pragma once
#include <fstream>
#include <string.h>
#include <sstream>
using namespace std;
string Search(string& ex) {
string word = "";
int i;
for (i = 0; i < ex.size(); i++) {
if (ex[i] == ' ') {
break;
}
word = word + ex[i];
}
ex.erase(0, i + 1);
return word;
}
void QueensLoad(int*& queens, int& pointHu, int& pointCom, int& turn, int& The_End, int& n, int& free, int& time) {
ifstream file;
string ex = "";
string aux = "";
file.open("Saved.txt");
int cont = 0;
while (getline(file, ex)) {
aux = Search(ex);
queens[0] = atoi(aux.c_str());
aux = Search(ex);
queens[1] = atoi(aux.c_str());
aux = Search(ex);
queens[2] = atoi(aux.c_str());
aux = Search(ex);
queens[3] = atoi(aux.c_str());
aux = Search(ex);
queens[4] = atoi(aux.c_str());
aux = Search(ex);
queens[5] = atoi(aux.c_str());
aux = Search(ex);
queens[6] = atoi(aux.c_str());
aux = Search(ex);
queens[7] = atoi(aux.c_str());
aux = Search(ex);
pointHu = atoi(aux.c_str());
aux = Search(ex);
pointCom = atoi(aux.c_str());
aux = Search(ex);
turn = atoi(aux.c_str());
aux = Search(ex);
The_End = atoi(aux.c_str());
aux = Search(ex);
n = atoi(aux.c_str());
aux = Search(ex);
free = atoi(aux.c_str());
aux = Search(ex);
time = atoi(aux.c_str());
}
file.close();
}