forked from jyt0532/blackjack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHuman.cpp
41 lines (41 loc) · 1.18 KB
/
Human.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
#include <iostream>
#include <time.h>
#include <vector>
#include "Hand.cpp"
using namespace std;
#ifndef HUMAN_CLASS
#define HUMAN_CLASS
class Human{
public:
Human();
int get_wager();
void set_strategy(int hard_strategy[22][11], int soft_strategy[22][11], int split_strategy[11][11]);
vector<Hand> hands;
int hard[22][11];
int soft[22][11];
int split[11][11];
void check_hand(int hand_index, DeckOfCard &doc, Card dealer_card);
};
Human::Human(){}
void Human::set_strategy(int hard_strategy[22][11], int soft_strategy[22][11], int split_strategy[11][11]){
for(int i = 0; i < 22; i++){
for(int j = 0; j < 11; j++){
hard[i][j] = hard_strategy[i][j];
}
}
for(int i = 0; i < 21; i++){
for(int j = 0; j < 11; j++){
soft[i][j] = soft_strategy[i][j];
}
}
for(int i = 0; i < 11; i++){
for(int j = 0; j < 11; j++){
split[i][j] = split_strategy[i][j];
}
}
}
void Human::check_hand(int hand_index, DeckOfCard &doc, Card dealer_card){
hands[hand_index].check_cards(doc, dealer_card, hands.size(), hard, soft, split);
return;
}
#endif