diff --git a/baccarat7up.cpp b/baccarat7up.cpp index b81cf9e..0abd9e3 100644 --- a/baccarat7up.cpp +++ b/baccarat7up.cpp @@ -1,6 +1,6 @@ #include "baccarat7up.h" -Hand::Hand() : vector() { +Hand::Hand() : vector() { } int Hand::getTotal() { @@ -8,7 +8,7 @@ int Hand::getTotal() { for (vector::iterator iter=this->begin(); iter!=this->end(); iter++) { total += *iter; } - return (total%10); + return (total%10); } bool Hand::isNatural() { @@ -121,11 +121,11 @@ CSM::CSM(int minDepth) { int CSM::deal() { int card, pos; - while (buffer.size() < 1+minBufferDepth) { - pos = reservoir.size()*random.genrand64_real2(); - buffer.insert(buffer.end(), reservoir[pos]); - reservoir.erase(reservoir.begin()+pos); - } + while (buffer.size() < 1+minBufferDepth) { + pos = reservoir.size()*random.genrand64_real2(); + buffer.insert(buffer.end(), reservoir[pos]); + reservoir.erase(reservoir.begin()+pos); + } card = buffer[0]; buffer.erase(buffer.begin()); return card; diff --git a/baccarat7up.h b/baccarat7up.h index 1cbcdeb..fe690a3 100644 --- a/baccarat7up.h +++ b/baccarat7up.h @@ -10,39 +10,39 @@ using namespace std; class Hand : public vector { public: - Hand(); - int getTotal(); - bool isNatural(); + Hand(); + int getTotal(); + bool isNatural(); }; class CSM { protected: - Mersenne64 random; - vector buffer; + Mersenne64 random; + vector buffer; int minBufferDepth; vector reservoir; public: - CSM(int); - virtual int deal(); - virtual void muck(int); + CSM(int); + virtual int deal(); + virtual void muck(int); }; class ShuffleMaster126 : public CSM { protected: - vector slots[NUM_SLOTS]; + vector slots[NUM_SLOTS]; void dropSlot(); - int maxCardsPerSlot; + int maxCardsPerSlot; public: - ShuffleMaster126(int minDepth, int maxDepth); - virtual int deal(); - virtual void muck(int); + ShuffleMaster126(int minDepth, int maxDepth); + virtual int deal(); + virtual void muck(int); }; class Rules7Up { public: - static void deal(Hand &player, Hand &banker, CSM &shoe); - static double bankerOutcome(Hand &player, Hand &banker); - static double playerOutcome(Hand &player, Hand &banker); + static void deal(Hand &player, Hand &banker, CSM &shoe); + static double bankerOutcome(Hand &player, Hand &banker); + static double playerOutcome(Hand &player, Hand &banker); static double super7s(Hand &player, Hand &banker); };