Hey guys. My lab for this week is to write a fairly complex blackjack program and i due by tomorrow night and I have no idea where to begin. I only have a successful do loop for the number of players entered. Please help. Thanks.
/* Programmer: MK
Course: COMP220
Assignment: Two-Dimensional Arrays
Description: The program will use a 2D array and a random-number
generation to play Blackjack and keep track of a playing-card deck.
Input: User data entry and a playing-card deck represented as a two-
dimensional array
Output: A screen display showing the current card hands of each player
and the dealer, their score, win and lose status, and a final representation
of the card deck after the game is over */
void main (void)
{
bool bPlayerDraw[5]; //Boolean to determine if player holds (F)
//or draws card (T)
char cPlay = 'N'; //Character variable for play game input
char cCardDeck[4][13]; //Character array representing the card deck
int iCard; //Card array index
//0 = 2 card
//1 = 3 card
//2 = 4 card
//3 = 5 card
//4 = 6 card
//5 = 7 card
//6 = 8 card
//7 = 9 card
//8 = 10 card
//9 = jack card
//10 = queen card
//11 = king card
//12 = ace card
int iNumberOfDraws = 0; //Number of rounds of card draws
int iSuit; //Suit array index
//0 = diamonds
//1 = hearts
//2 = clubs
//3 = spades
// ASCII character display reference for display card suit symbols
//3 = heart symbol
//4 = diamond symbol
//5 = club symbol
//6 = spade symbol
int iNumberOfPlayers = 0;//Number of players in current game
int iPlayerCount[5]; //Integer array to holder each player's count
//iPlayer[0] is always the dealer
int iHighestCount = 0; //Highest count for a single game
int k, m; //integer loop counters
srand(GetTickCount()); //Seed the random-number generator
//Main game loop
//Enter your code hereā¦
cout << "Welcome to Honest Sam's Blackjack Table. "<<endl<< "Glad to have you back!"<<endl;
do
{
cout << "Enter number of players: ";
cin >> iNumberOfPlayers;
}
while (iNumberOfPlayers <= 0 || iNumberOfPlayers > 4);
}
obviously the code entered after "Enter your code here..." is what I've written... I've no idea where to go from here. I hardly know strings at all and I can barely write an array, since it's been a whole semester since my last programming course. this is my 2nd C++ course and the teacher isn't very helpful. :/
Perhaps the best way to start is to make it work for just 1 human player and then add a computer dealer...and computer players at the end. Simplify the task.