1 player Black jack for mbed

Dependencies:   4DGL-uLCD-SE PinDetect mbed

Revision:
0:d2e6b3ce6988
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deck.cpp	Thu Mar 12 19:48:26 2015 +0000
@@ -0,0 +1,32 @@
+#include "deck.h"
+#include <time.h>
+Deck::Deck ()
+{
+    int index = 0;
+    for (int suit = 0; suit <= 3; suit++) {
+        for (int rank =1; rank < 14; rank++) {
+            cards[index]._rank= rank;
+            cards[index]._suit = suit;
+            index++;
+        }
+    }
+}
+void Deck::shuffleDeck()
+{
+    int ran;
+    srand(time(NULL));
+    for (int i=0; i< 52; i++) {
+
+        ran = randomInt(i,51);
+
+        Card::swapCards(cards,i,ran);
+
+    }
+}
+int Deck::randomInt(int low ,int high)
+{
+    float ran = (rand()%52)*1.0;
+    ran = ran/52.0;
+    return (int)(((high-low)*(ran))+low);
+}
+