-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
52 lines (43 loc) · 1.11 KB
/
main.cpp
File metadata and controls
52 lines (43 loc) · 1.11 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
#define STAKE_AMOUNT 100
#define PLAYERS_COUNT 3
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <vector>
#include <algorithm>
#include <string.h>
#include "card.h"
#include "deck.h"
#include "player.h"
#include "game.h"
using namespace std;
int main()
{
std::cout << "Добро пожаловать в BlackJack!" << std::endl;
char username[80];
do
{
std::cout << "Введите пожалуйста свое имя:";
std::cin.getline(username,80);
}while(strlen(username)==0);
vector<Player*> players;
Deck deck;
Player bot1(Player::OPPONENT, &deck,"Bot1");
Player bot2(Player::OPPONENT, &deck,"Bot2");
Player user(Player::USER, &deck, username);
Player dealer(Player::DEALER, &deck, "Dealer");
players.push_back(&bot1);
players.push_back(&bot2);
players.push_back(&user);
players.push_back(&dealer);
Game game(players,&deck);
game.make_stakes();
game.deal_cards();
if(!game.is_there_black_jack())
{
game.make_move();
}
game.calculate_scores();
game.declare_winner();
return 0;
}