Difference: Lab9 (22 vs. 23)

Revision 232017-11-28 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Lab 9 - Blackjack

Line: 294 to 294
 void seedRandom() { srand(time(NULL)); }
Changed:
<
<
double nextRandom() { double random = ((double) rand()) / RAND_MAX;
>
>
// random number between 0 and 51 int nextRandom() { int random = rand()%52;
  return random; }
Line: 330 to 330
 }

Card Deck::Deal() {

Changed:
<
<
// Make a special zero valued card in case we have nothing left
>
>
// // Before dealing, check if the deck is empty, if so repopulate and shuffle, then draw.
  Card aCard(BLANK,CLUBS); if (m_Cards.empty()) { aCard = m_Cards.back();
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback