Sample Resume : A Program

867 Words4 Pages
// Lesson 23: Blackjack program // Author: Michael Hall // // This program is available for download through our website with no guarantees. // Disclaimer: While we have made every effort to ensure the quality of our content, all risks associated // with downloading or using this solution, project and code are assumed by the user of this material. // // Copyright 2008 Xoax - For personal use only, not for distribution #include #include void Shuffle(bool baCardsDealt[]); void PrintCard(int iCard); void PrintHand(int iaHand[], const int kiCardCount); int GetNextCard(bool baCardsDealt[]); int ScoreHand(int iaHand[], const int kiCardCount); void PrintScoresAndHands(int iaHouseHand[], const int kiHouseCardCount, int iaPlayerHand[], const int kiPlayerCardCount); int main() { using namespace std; // Seed the random number generator time_t qTime; time(&qTime); srand(qTime); bool baCardsDealt[52]; int iHouseCardCount = 0; int iaHouseHand[12]; int iPlayerCardCount = 0; int iaPlayerHand[12]; // Loop once for each hand while (true) { // "Shuffle" the cards; set them all to undealt Shuffle(baCardsDealt); // Deal the hands. Get two cards for each iaPlayerHand[0] = GetNextCard(baCardsDealt); iaHouseHand[0] = GetNextCard(baCardsDealt); iaPlayerHand[1] = GetNextCard(baCardsDealt); iaHouseHand[1] = GetNextCard(baCardsDealt); iHouseCardCount = 2; iPlayerCardCount = 2; // Signal a new hand. cout <<
Get Access