-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
50 lines (45 loc) · 1.32 KB
/
main.cpp
File metadata and controls
50 lines (45 loc) · 1.32 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
#include "card.h"
#include "deck.h"
#include <iostream>
void testDraw(){
std::cout << "[Drawing a random card from a full deck]" << std::endl;
Deck deck;
deck.populate(0,0);
deck.shuffle();
std::cout << deck.drawCard().toString() << std::endl;
}
void testPrintAll(){
std::cout << "[Drawing and printing all cards in order]" << std::endl;
Deck deck;
deck.populate(0,0);
int numCards = deck.getNumCards();
for (int i = numCards - 1; i >= 0; i--){
std::cout << deck.drawCard().toString() << std::endl;
}
}
void testPrintShortWithJoker(){
std::cout << "[Drawing and printing a 4 times low-shortened deck of cards with 3 Jokers in order]" << std::endl;
Deck deck;
deck.populate(4,3);
int numCards = deck.getNumCards();
for (int i = numCards - 1; i >= 0; i--){
std::cout << deck.drawCard().toString() << std::endl;
}
}
void testPrintShuffle(){
std::cout << "[Drawing and printing all cards shuffled using system time]" << std::endl;
Deck deck;
deck.populate(0,0);
deck.shuffle();
int numCards = deck.getNumCards();
for (int i = numCards - 1; i >= 0; i--){
std::cout << deck.drawCard().toString() << std::endl;
}
}
int main(){
testDraw();
testPrintAll();
testPrintShortWithJoker();
testPrintShuffle();
return 0;
}