Black Jack Game need help

I am making a simple black jack game and I good idea on what I need to do to finish it. However, I am not happy with the functions that I have made called Draw1 through Draw4 because I keep repeating the same code and the drawing of the cards is not as good as I would like but I am not sure how to fix it. Any suggestion on how to make this code more efficient would be great.




void draw1()
{
cls();
string a = card[fullDeck[0]].face; //first starting card
string b = card[fullDeck[0]].suite;
string c = card[fullDeck[1]].face; //second card
string d = card[fullDeck[1]].suite;
string e = card[fullDeck[45]].face; //computers cards
string f = card[fullDeck[45]].suite; //computers cards
computershand =card[fullDeck[45]].vaule;
//put a if statment here to check for aces!!
//put a functions check for aces and have it return the a total for players hand!
playershand= card[fullDeck[0]].vaule + card[fullDeck[1]].vaule;
cout<<" DEALERS HAND "<<"\n";
cout<<" _________ _________ "<<"\n";
cout<<" |"<<e<<" "<<"\n";
cout<<" | | |@@@@@@@@@| "<<"\n";
cout<<" | | |@@@@@@@@@| "<<"\n";
cout<<" | | |@@@@@@@@@| "<<"\n";
cout<<" | "<<f<<" "<<"\n";
cout<<" | | |@@@@@@@@@| "<<"\n";
cout<<" | | |@@@@@@@@@| "<<"\n";
cout<<" | | |@@@@@@@@@| "<<"\n";
cout<<" | "<<e<<" "<<"\n";
cout<<" |_________| |_________| "<<"\n";
cout<<" Hand Total= "<<computershand<<"\n\n\n";
cout<<" PLAYERS HAND "<<"\n";
cout<<" _________ _________ "<<"\n";
cout<<" |"<<a<<" "<<c<<" "<<"\n";
cout<<" | | | | "<<"\n";
cout<<" | | | | "<<"\n";
cout<<" | | | | "<<"\n";
cout<<" | "<<b<<" "<<d<<" "<<"\n";
cout<<" | | | | "<<"\n";
cout<<" | | | | "<<"\n";
cout<<" | | | | "<<"\n";
cout<<" | "<<a<<" "<<c<<"\n";
cout<<" |_________| |_________| "<<"\n";
cout<<" Hand Total= "<<playershand;


}

void draw2()
{
cls();
string a = card[fullDeck[0]].face; //first starting card
string b = card[fullDeck[0]].suite;//frist starting card
string c = card[fullDeck[1]].face; //second card
string d = card[fullDeck[1]].suite; //second card
string e = card[fullDeck[45]].face; //computers cards
string f = card[fullDeck[45]].suite; //computers cards
string g = card[fullDeck[2]].face; //thrid card
string h = card[fullDeck[2]].suite;//thrid card
computershand =card[fullDeck[45]].vaule;
playershand= card[fullDeck[0]].vaule + card[fullDeck[1]].vaule + card[fullDeck[2]].vaule;;
cout<<" DEALERS HAND "<<"\n";
cout<<" _________ _________ "<<"\n";
cout<<" |"<<e<<" "<<"\n";
cout<<" | | |@@@@@@@@@| "<<"\n";
cout<<" | | |@@@@@@@@@| "<<"\n";
cout<<" | | |@@@@@@@@@| "<<"\n";
cout<<" | "<<f<<" "<<"\n";
cout<<" | | |@@@@@@@@@| "<<"\n";
cout<<" | | |@@@@@@@@@| "<<"\n";
cout<<" | | |@@@@@@@@@| "<<"\n";
cout<<" | "<<e<<" "<<"\n";
cout<<" |_________| |_________| "<<"\n";
cout<<" Hand Total= "<<computershand<<"\n\n\n";
cout<<" PLAYERS HAND "<<"\n";
cout<<" _________ _________ _________ "<<"\n";
cout<<" |"<<a<<" "<<c<<" "<<g<<" "<<"\n";
cout<<" | | | | | | "<<"\n";
cout<<" | | | | | | "<<"\n";
cout<<" | | | | | | "<<"\n";
cout<<" | "<<b<<" "<<d<<" "<<h<<" "<<"\n";
cout<<" | | | | | | "<<"\n";
cout<<" | | | | | | "<<"\n";
cout<<" | | | | | | "<<"\n";
cout<<" | "<<a<<" "<<c<<" "<<g<<" "<<"\n";
cout<<" |_________| |_________| |_________| "<<"\n";
cout<<" Hand Total= "<<playershand;


}


//the dealers table is were all the functions pull together.
void dealers_table()
{

string answer;
while (play == true)
{

switch(plus_one)
{
case 1:
draw1();
break;

case 2:
draw2();
break;

case 3:
draw3();
break;
}

cout<<"\n\n\n Would you like to hit or stay? (H/S)";
cin>>answer;

if(answer == "H")
{
plus_one++;
}
else{exit(0);}



}
}









int main()
{
opening();
seed();
setup_deck();
Shuffle_Deck();
plus_one=1;
dealers_table();


}

[/code]
Topic archived. No new replies allowed.