-
Notifications
You must be signed in to change notification settings - Fork 0
/
Deck.h
74 lines (59 loc) · 1.55 KB
/
Deck.h
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
//
// Created by Michael Carroll on 2019-02-17.
//
#ifndef SOLITAIRE_DECK_H
#define SOLITAIRE_DECK_H
#include <vector>
#include <time.h>
#include <random>
class Card;
using namespace std;
/**
* An object of type Deck represents an ordinary deck of 52 playing cards.
* The deck can be shuffled, and cards can be dealt from the deck.
* @author jsupton
* @author Wilmot Osei-Bonsu
* @version Febuary 16 2019
*/
class Deck {
//access modifier
public:
// An arrayList of the deck of cards
vector<Card> deck;
//A Number of cards for the deck
int NumberOfCards;
/**
* Default constructor. It simply creates a deck of 52 cards
*/
Deck();
/**
* Shuffles the deck using the Fisher-Yates algorithm
*/
void shuffle();
/**
* Creates a new shuffled deck of cards in an order that guarantees that the
* User will win their solitaire game
*/
void shuffle_WIN();
/**
* Creates a new shuffled deck of cards in an order that guarantees that the
* User will win their solitaire game
*/
void shuffle_WIN2();
/**
* Creates a new shuffled deck of cards in an order that guarantees that the
* User will lose their solitaire game
*/
void shuffle_LOSE();
/**
* Gets the deck of cards
* @return ArrayList<Cards> representing the current deck
*/
vector<Card> * getDeck();
/*
* Generates a normal distribution random number between 0 and 1.
* @return Random double between 0 and 1.
*/
double random();
};
#endif //SOLITAIRE_DECK_H