-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcards.cpp
More file actions
43 lines (37 loc) · 1.26 KB
/
cards.cpp
File metadata and controls
43 lines (37 loc) · 1.26 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
#include <iostream>
#include <string>
#include <random>
#include <chrono>
using namespace std;
class CardObject {
private:
string suits[4] {
"C", "S", "H", "D"
};
string values[13] {
"1", "2", "3", "4","5", "6", "7", "8", "9", "10", "J","Q","K"
};
public:
string card_structure[7][7] {
{"-","-","-","-","-","-","-"},
{"|"," "," "," "," "," ","|"},
{"|"," "," "," "," "," ","|"},
{"|"," "," ",""," "," ","|"},
{"|"," "," "," "," "," ","|"},
{"|"," "," "," "," "," ","|"},
{"-","-","-","-","-","-","-"},
};
void cardCreator(){
mt19937 mt{ random_device{}()};
//establishing
uniform_int_distribution<> suit_selector{0,3};
uniform_int_distribution<> value_selector{0,12};
string chosen_suit = suits[suit_selector(mt)];
string chosen_value = values[value_selector(mt)];
if (chosen_value == "10")
card_structure[3][5] = "";
card_structure[1][1] = chosen_suit;
card_structure[5][5] = chosen_suit;
card_structure[3][3] = chosen_value;
}
};