-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCards.cpp
More file actions
84 lines (76 loc) · 1.95 KB
/
Cards.cpp
File metadata and controls
84 lines (76 loc) · 1.95 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
using namespace std;
#include <iostream>
#include <string>
#include <algorithm>
#include <random>
#include <vector>
class Card1{
private:
vector<string> s1= {"Honest", "Alloys", "Beasts", "Duffer"};
public:
string showString(){
random_device rd;
mt19937 g(rd());
shuffle(s1.begin(), s1.end(), g);
return s1[0];
}
bool is_word_in_card1(string cd){
for(string c: s1){
if (cd == showString()){
return true;
}
}
return false;
}
}c1;
class Card2{
private:
vector<string> s2 = {"Knowledge", "Acceptive", "Dejection", "Carbonize", "Delicious"};
public:
string showString(){
random_device rd;
mt19937 g(rd());
shuffle(s2.begin(), s2.end(), g);
return s2[0];
}
bool is_word_in_card2(string cd){
for(string c: s2){
if (cd == showString()){
return true;
}
}
return false;
}
}c2;
class Card3{
private:
vector<string> s3 = {"Punctual", "Elephant", "Bloggers", "Mountain"};
public:
string showString(){
random_device rd;
mt19937 g(rd());
shuffle(s3.begin(), s3.end(), g);
return s3[0];
}
bool is_word_in_card3(string cd){
for(string c: s3){
if (cd == showString()){
return true;
}
}
return false;
}
}c3;
class User{
private:
string name;
public:
string get_name(){
string name;
cout<<"Enter your name: ";
getline(cin,this->name);
name = this->name;
return name;
}
}u;
vector<string> words = {c1.showString(), c2.showString(), c3.showString()};