-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfinds.cpp
More file actions
95 lines (82 loc) · 2.21 KB
/
Copy pathfinds.cpp
File metadata and controls
95 lines (82 loc) · 2.21 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include "finds.h"
finds::finds(){}
finds::~finds(){}
void finds::set_hypothesis1(std::vector<char> v){
this->hypothesis1=v;
}
void finds::set_hypothesis2(std::vector<char> v){
this->hypothesis2=v;
}
void finds::set_hypothesis3(std::vector<char> v){
this->hypothesis3=v;
}
void finds::set_hypothesis4(std::vector<char> v){
this->hypothesis4=v;
}
void finds::to_string(){
std::cout << "hypothesis1" << '\n';
for (size_t i = 0; i < this->hypothesis1.size(); i++) {
/* code */
std::cout << this->hypothesis1[i] << ' ';
}
std::cout << '\n';
std::cout << "hypothesis2" << '\n';
for (size_t i = 0; i < this->hypothesis2.size(); i++) {
/* code */
std::cout << this->hypothesis2[i] << ' ';
}
std::cout << '\n';
std::cout << "hypothesis3" << '\n';
for (size_t i = 0; i < this->hypothesis3.size(); i++) {
/* code */
std::cout << this->hypothesis3[i] << ' ';
}
std::cout << '\n';
std::cout << "hypothesis4" << '\n';
for (size_t i = 0; i < this->hypothesis4.size(); i++) {
/* code */
std::cout << this->hypothesis4[i] << ' ';
}
std::cout << '\n';
std::cout << "enjoy sport" << '\n';
for (size_t i = 0; i < this->enjoy_sport.size(); i++) {
/* code */
for (size_t j = 0; j < this->enjoy_sport[i].size(); j++) {
/* code */
std::cout << this->enjoy_sport[i][j] << ' ';
}
std::cout << '\n';
}
}
void finds::set_enjoy_sport(){
this->enjoy_sport.push_back(this->hypothesis1);
this->enjoy_sport.push_back(this->hypothesis2);
this->enjoy_sport.push_back(this->hypothesis3);
this->enjoy_sport.push_back(this->hypothesis4);
}
void finds::compare_hypothesis(){
std::vector<char> v=this->hypothesis1;
for (size_t i = 1; i < this->enjoy_sport.size(); i++) {
/* code */
for (size_t j = 0; j < this->enjoy_sport[i].size(); j++) {
/* code */
if (this->enjoy_sport[i][6]=='N') {
/* code */
break;
}
else{
if (this->enjoy_sport[i][j]!=v[j]) {
/* code */
v[j]='?';
}
}
}
std::cout << "iteration" << ' ' << i;
std::cout << '\n';
for (size_t k = 0; k < v.size(); k++) {
/* code */
std::cout << v[k] << ' ';
}
std::cout << '\n';
}
}