aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301
diff options
context:
space:
mode:
Diffstat (limited to 'ee1301')
-rw-r--r--ee1301/wk6/lab5/strap012_lab5_w_1.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/ee1301/wk6/lab5/strap012_lab5_w_1.cpp b/ee1301/wk6/lab5/strap012_lab5_w_1.cpp
index d3684fb..4020b98 100644
--- a/ee1301/wk6/lab5/strap012_lab5_w_1.cpp
+++ b/ee1301/wk6/lab5/strap012_lab5_w_1.cpp
@@ -1,10 +1,10 @@
#include <iostream>
#include <string>
-#include <time.h> //MinGW does not compile without this included when time is involved.
+#include <time.h> //MinGW refuses to compile without this included when time is involved.
class DeckOfCards {
private:
- int index=0, deck[53]; //deck is size 53 as a hack designed to prevent segfaults.
+ int index=0, deck[52];
public:
DeckOfCards();
void shuffle();
@@ -47,7 +47,7 @@ void showHand(int hand[], const int size) {
//Deck initialized with 1-52 and shuffled
DeckOfCards::DeckOfCards() {
- for(int i=0; i<52; i++) {
+ for(int i=0; i<51; i++) {
deck[i]=i+1;
}
shuffle();