# blackjack 21: console game

Email
 Submitted on: 1/1/2015 3:58:00 AM By: Anonymous (from psc cd) Level: Intermediate User Rating: By 2 Users Compatibility: C++ (general) Views: 1718

BLACKJACK VS THE COMP, My code probably isn't that great, but it works...

code:
Can't Copy and Paste this?
 ``` //************************************** // Name: blackjack 21: console game // Description:BLACKJACK VS THE COMP, My code probably isn't that great, but it works... // By: Anonymous (from psc cd) //************************************** //This game simulates a simplified version of the card game 21 #include //include neccesary libraries #include #include int you1,you2,you3, c1, c2, c3,ans,you,comp,ans2,youpoint,comppoint,drawpoint; //you1,2,3 are random #'s for player, C1,2,3 are random #'s for computer // ans is # of cards, you and comp are total scores, youpoint compoint and drawpoint are total points for each char yesno;//used to loop program int main() { yesno='y'; comppoint=0; youpoint=0; drawpoint=0;//declares variable starting point cout << "Ryan Fogarty" << endl << "Lab 21 Game" <> ans; srand (time(NULL));// generates random #'s for comp and player you1 =(rand()%(10)) +1; //from 1 to 10 you2 =(rand()%(10)) +1; //from 1 to 10 you3 =(rand()%(10)) +1; //from 1 to 10 c1 =(rand()%(10)) +1; //from 1 to 10 c2 =(rand()%(10)) +1; //from 1 to 10 c3=(rand()%(10)) +1; //from 1 to 10 if (ans==1) { cout <<"You: "<< you1 < comp)&&(you<=21)||(comp>21)) { cout <<"I have " < you)&&(comp<=21)||(you>21)) { cout <<"I have " <> yesno; cout << endl; } cout << "\nComputer Wins = "<

Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)