By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,445 Members | 1,329 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,445 IT Pros & Developers. It's quick & easy.

cardgame point system

P: 5
can some1 help me to get started on teh point system.
jack = 1 pt
queen = 2 pts
king = 3 pts
ace = 4 pts
below is wat i done so far but i hav no idea how to start the points system

Expand|Select|Wrap|Line Numbers
  1. //player 2
  2.     cout << "\n\nPlayer 2\n\n";
  3.     for (int i = 0; i < 13; i++)
  4.     {
  5.              Card = rand() % 13;              
  6.              Suit = rand() % 4;               
  7.  
  8.              while (Cards[Suit][Card]==1){
  9.                    Card = rand() % 13;
  10.                    Suit = rand() % 4;
  11.              } 
  12.  
  13.              Cards[Suit][Card]=1;                                   
  14.              cout << cards[Card] <<  " of " << "[" << suits[Suit] << "]" << ", ";
  15.     }
  16.         cout << "\nTotal Points: " << points;
  17.         cout << "\n-------------------------------------------";
May 28 '07 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
I do not believ that you have a code problem. Instead, I believe you have a design problem. You cannot just start coding and expect a result.

I suggest you write down in words of your native tongue the steps you will follow to deal this deck.

Then, convert the sentences to C/C++ comments.

Then code the sentence below the comment.

You will be amazed at how fast this works.
May 28 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.